Author: bapt
Date: Thu Dec 27 20:24:44 2012
New Revision: 244744
URL: http://svnweb.freebsd.org/changeset/base/244744

Log:
  Add O_CLOEXEC to flopen
  
  Requested by: jilles

Modified:
  head/lib/libutil/gr_util.c
  head/lib/libutil/pw_util.c

Modified: head/lib/libutil/gr_util.c
==============================================================================
--- head/lib/libutil/gr_util.c  Thu Dec 27 19:43:29 2012        (r244743)
+++ head/lib/libutil/gr_util.c  Thu Dec 27 20:24:44 2012        (r244744)
@@ -101,7 +101,7 @@ gr_lock(void)
        for (;;) {
                struct stat st;
 
-               lockfd = flopen(group_file, O_RDONLY|O_NONBLOCK, 0);
+               lockfd = flopen(group_file, O_RDONLY|O_NONBLOCK|O_CLOEXEC, 0);
                if (lockfd == -1) {
                        if (errno == EWOULDBLOCK) {
                                errx(1, "the group file is busy");

Modified: head/lib/libutil/pw_util.c
==============================================================================
--- head/lib/libutil/pw_util.c  Thu Dec 27 19:43:29 2012        (r244743)
+++ head/lib/libutil/pw_util.c  Thu Dec 27 20:24:44 2012        (r244744)
@@ -179,7 +179,7 @@ pw_lock(void)
        for (;;) {
                struct stat st;
 
-               lockfd = flopen(masterpasswd, O_RDONLY|O_NONBLOCK, 0);
+               lockfd = flopen(masterpasswd, O_RDONLY|O_NONBLOCK|O_CLOEXEC, 0);
                if (lockfd == -1) {
                        if (errno == EWOULDBLOCK) {
                                errx(1, "the password db file is busy");
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to