Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 0ad3d0d

Browse files
committed
Use FD_CLOEXEC instead of equivalent 1 in InternalCreatePipe
1 parent 7c1c0c5 commit 0ad3d0d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pal/src/file/file.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4056,14 +4056,14 @@ CorUnix::InternalCreatePipe(
40564056

40574057
/* enable close-on-exec for both pipes; if one gets passed to CreateProcess
40584058
it will be "uncloseonexeced" in order to be inherited */
4059-
if(-1 == fcntl(readWritePipeDes[0],F_SETFD,1))
4059+
if(-1 == fcntl(readWritePipeDes[0],F_SETFD,FD_CLOEXEC))
40604060
{
40614061
ASSERT("can't set close-on-exec flag; fcntl() failed. errno is %d "
40624062
"(%s)\n", errno, strerror(errno));
40634063
palError = ERROR_INTERNAL_ERROR;
40644064
goto InternalCreatePipeExit;
40654065
}
4066-
if(-1 == fcntl(readWritePipeDes[1],F_SETFD,1))
4066+
if(-1 == fcntl(readWritePipeDes[1],F_SETFD,FD_CLOEXEC))
40674067
{
40684068
ASSERT("can't set close-on-exec flag; fcntl() failed. errno is %d "
40694069
"(%s)\n", errno, strerror(errno));

0 commit comments

Comments
 (0)