]> granicus.if.org Git - libevent/commitdiff
Do not assume we know the value for FD_CLOEXEC.
authorNick Mathewson <nickm@torproject.org>
Thu, 21 May 2009 20:59:17 +0000 (20:59 +0000)
committerNick Mathewson <nickm@torproject.org>
Thu, 21 May 2009 20:59:17 +0000 (20:59 +0000)
svn:r1301

listener.c

index e31279c8017840e0ab7281bcdd6ad08f2c732d69..bd7176d5b946c9220695218b5db919d2592f43c5 100644 (file)
@@ -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;
                }