Use FD_CLOEXEC instead of 1. (dotnet/coreclr#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)
Commit migrated from https://github.com/dotnet/coreclr/commit/3c1e90c1bbd7d701f0257ed2a8de02025055d9fc

src/coreclr/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));