mirror of
https://github.com/osmarks/ngircd.git
synced 2025-06-10 10:24:07 +00:00
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);
|
int flags = fcntl(fd, F_GETFD);
|
||||||
if (flags == -1)
|
if (flags == -1)
|
||||||
return false;
|
return false;
|
||||||
|
#ifdef FD_CLOEXEC
|
||||||
flags |= FD_CLOEXEC;
|
flags |= FD_CLOEXEC;
|
||||||
|
#endif
|
||||||
|
|
||||||
return fcntl(fd, F_SETFD, flags) == 0;
|
return fcntl(fd, F_SETFD, flags) == 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user