introduce and use close_on_exec_on(fd). -50 bytes.
This commit is contained in:
@ -164,6 +164,11 @@ int ndelay_on(int fd)
|
||||
return fcntl(fd, F_SETFL, fcntl(fd,F_GETFL) | O_NONBLOCK);
|
||||
}
|
||||
|
||||
int close_on_exec_on(int fd)
|
||||
{
|
||||
return fcntl(fd, F_SETFD, FD_CLOEXEC);
|
||||
}
|
||||
|
||||
int ndelay_off(int fd)
|
||||
{
|
||||
return fcntl(fd, F_SETFL, fcntl(fd,F_GETFL) & ~O_NONBLOCK);
|
||||
|
Reference in New Issue
Block a user