Use FD_CLOEXEC instead of 1. (#18976)
authorJay Krell <jay.krell@cornell.edu>
Wed, 18 Jul 2018 19:00:19 +0000 (12:00 -0700)
committerJan Kotas <jkotas@microsoft.com>
Wed, 18 Jul 2018 19:00:19 +0000 (12:00 -0700)
src/pal/src/file/file.cpp

index 3f453c1..0d30487 100644 (file)
@@ -687,7 +687,7 @@ CorUnix::InternalCreateFile(
     
     /* make file descriptor close-on-exec; inheritable handles will get
       "uncloseonexeced" in CreateProcess if they are actually being inherited*/
-    if(-1 == fcntl(filed,F_SETFD,1))
+    if(-1 == fcntl(filed,F_SETFD, FD_CLOEXEC))
     {
         ASSERT("can't set close-on-exec flag; fcntl() failed. errno is %d "
              "(%s)\n", errno, strerror(errno));