Use O_CLOEXEC wherever we open a file and then call fcntl(F_SETFD, FD_CLOEXEC)
authorguenther <guenther@openbsd.org>
Fri, 15 Aug 2014 03:51:40 +0000 (03:51 +0000)
committerguenther <guenther@openbsd.org>
Fri, 15 Aug 2014 03:51:40 +0000 (03:51 +0000)
commit0205f8e66ce8c2d9c439542953f237a17f23b194
tree145b45ce27a69aca56b4834c4cd72e953fad812f
parent5b92aaac1a81010b2905c3d5380866a94c3146ce
Use O_CLOEXEC wherever we open a file and then call fcntl(F_SETFD, FD_CLOEXEC)
on it, simplifying error checking, reducing system calls, and improving
thread-safety for libraries.

ok miod@
lib/libc/db/hash/hash.c
lib/libkvm/kvm.c
lib/libsndio/mio_rmidi.c
lib/libsndio/sio_sun.c
lib/libutil/passwd.c
usr.bin/mail/names.c
usr.bin/usbhidaction/usbhidaction.c
usr.sbin/apmd/apmd.c
usr.sbin/cron/misc.c