correct O_CLOEXEC to FD_CLOEXEC for F_SETFL
parent
e254b8e1d3
commit
4a7d852409
|
|
@ -730,7 +730,7 @@ int fd_add_flags(int fd, int adding_flags);
|
|||
* fd: the fd to set
|
||||
* return: error no , 0 success, != 0 fail
|
||||
*/
|
||||
#define set_nonblock(fd) fd_add_flags(fd, O_NONBLOCK)
|
||||
#define set_nonblock(fd) fd_add_flags(fd, O_NONBLOCK | FD_CLOEXEC)
|
||||
|
||||
/** set fd FD_CLOEXEC flags
|
||||
* parameters:
|
||||
|
|
|
|||
|
|
@ -2126,7 +2126,7 @@ int tcpsetnonblockopt(int fd)
|
|||
return errno != 0 ? errno : EACCES;
|
||||
}
|
||||
|
||||
if (fcntl(fd, F_SETFL, flags | (O_NONBLOCK | O_CLOEXEC)) < 0)
|
||||
if (fcntl(fd, F_SETFL, flags | (O_NONBLOCK | FD_CLOEXEC)) < 0)
|
||||
{
|
||||
logError("file: "__FILE__", line: %d, " \
|
||||
"fcntl failed, errno: %d, error info: %s.", \
|
||||
|
|
|
|||
Loading…
Reference in New Issue