diff options
| author | Jacques Vidrine <nectar@FreeBSD.org> | 2002-09-13 14:53:43 +0000 | 
|---|---|---|
| committer | Jacques Vidrine <nectar@FreeBSD.org> | 2002-09-13 14:53:43 +0000 | 
| commit | 665e307511eec9d0e5878c83f6635a2b4b57515a (patch) | |
| tree | 37f909e2b10df176989e3f286e4fa8a47630a2e7 /lib | |
| parent | 8c82ecd75fe28f0bd89799ab77babbcd3053e1e0 (diff) | |
Notes
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libkvm/kvm.c | 12 | 
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/libkvm/kvm.c b/lib/libkvm/kvm.c index d4a7645857e9..e7bde960d3ea 100644 --- a/lib/libkvm/kvm.c +++ b/lib/libkvm/kvm.c @@ -206,6 +206,10 @@ _kvm_open(kd, uf, mf, flag, errout)  		_kvm_syserr(kd, kd->program, "%s", mf);  		goto failed;  	} +	if (fcntl(kd->pmfd, F_SETFD, FD_CLOEXEC) < 0) { +		_kvm_syserr(kd, kd->program, "%s", mf); +		goto failed; +	}  	if (S_ISCHR(st.st_mode)) {  		/*  		 * If this is a character special device, then check that @@ -224,6 +228,10 @@ _kvm_open(kd, uf, mf, flag, errout)  				_kvm_syserr(kd, kd->program, "%s", _PATH_KMEM);  				goto failed;  			} +			if (fcntl(kd->vmfd, F_SETFD, FD_CLOEXEC) < 0) { +				_kvm_syserr(kd, kd->program, "%s", _PATH_KMEM); +				goto failed; +			}  		}  	} else {  		/* @@ -235,6 +243,10 @@ _kvm_open(kd, uf, mf, flag, errout)  			_kvm_syserr(kd, kd->program, "%s", uf);  			goto failed;  		} +		if (fcntl(kd->nlfd, F_SETFD, FD_CLOEXEC) < 0) { +			_kvm_syserr(kd, kd->program, "%s", uf); +			goto failed; +		}  		if (_kvm_initvtop(kd) < 0)  			goto failed;  	}  | 
