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

MFC after:	1 week
This commit is contained in:
Jilles Tjoelker 2013-05-04 11:45:48 +00:00
parent 76dce67f0f
commit 7b05a79942

View File

@ -187,7 +187,7 @@ _kvm_open(kvm_t *kd, const char *uf, const char *mf, int flag, char *errout)
* 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)) <