Only try to set FD_CLOEXEC if this flag is defined
A/UX 3.x doesn't implement this constant, for example.
This commit is contained in:
parent
5f2bc55d36
commit
99e08eaced
|
@ -791,7 +791,9 @@ io_setcloexec(int fd)
|
|||
int flags = fcntl(fd, F_GETFD);
|
||||
if (flags == -1)
|
||||
return false;
|
||||
#ifdef FD_CLOEXEC
|
||||
flags |= FD_CLOEXEC;
|
||||
#endif
|
||||
|
||||
return fcntl(fd, F_SETFD, flags) == 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue