svn commit: r250507 - stable/9/lib/libkvm

Jilles Tjoelker jilles at FreeBSD.org
Sat May 11 12:43:27 UTC 2013


Author: jilles
Date: Sat May 11 12:43:26 2013
New Revision: 250507
URL: http://svnweb.freebsd.org/changeset/base/250507

Log:
  MFC r250231: libkvm: Make second /dev/null file descriptor close-on-exec as
  well.

Modified:
  stable/9/lib/libkvm/kvm.c
Directory Properties:
  stable/9/lib/libkvm/   (props changed)

Modified: stable/9/lib/libkvm/kvm.c
==============================================================================
--- stable/9/lib/libkvm/kvm.c	Sat May 11 11:56:50 2013	(r250506)
+++ stable/9/lib/libkvm/kvm.c	Sat May 11 12:43:26 2013	(r250507)
@@ -187,7 +187,7 @@ _kvm_open(kvm_t *kd, const char *uf, con
 		 * case you're working with a live kernel.)
 		 */
 		if (strcmp(mf, _PATH_DEVNULL) == 0) {
-			kd->vmfd = open(_PATH_DEVNULL, O_RDONLY);
+			kd->vmfd = open(_PATH_DEVNULL, O_RDONLY | O_CLOEXEC);
 			return (kd);
 		} else if (strcmp(mf, _PATH_MEM) == 0) {
 			if ((kd->vmfd = open(_PATH_KMEM, flag | O_CLOEXEC)) <


More information about the svn-src-stable-9 mailing list