mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
Do not assume we know the value for FD_CLOEXEC.
svn:r1301
This commit is contained in:
parent
7e3ea82ee6
commit
1ee65b7f94
@ -104,7 +104,7 @@ evconnlistener_new_bind(struct event_base *base, evconnlistener_cb cb, void *ptr
|
||||
|
||||
#ifndef WIN32
|
||||
if (flags & LEV_OPT_CLOSE_ON_EXEC) {
|
||||
if (fcntl(fd, F_SETFD, 1) == -1) {
|
||||
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) {
|
||||
EVUTIL_CLOSESOCKET(fd);
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user