diff options
author | Jardel Weyrich <jweyrich@gmail.com> | 2009-12-29 16:21:26 -0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-12-29 15:12:56 -0500 |
commit | d0939d2b971417cd5714b535dabfdbd4213b26cb (patch) | |
tree | 56537bd909fc49ee00f4c50d2a7464a9fe7aeeaf /epoll.c | |
parent | 4df7dbcbdfc9bf169f70b3e74e0a3ec824065bf3 (diff) | |
download | libevent-d0939d2b971417cd5714b535dabfdbd4213b26cb.tar.gz |
Introduced evutil_make_socket_closeonexec() to preserve fd flags for F_SETFD.
Use this to eliminate the various macros that called F_SETFD throughout
the code.
Diffstat (limited to 'epoll.c')
-rw-r--r-- | epoll.c | 11 |
1 files changed, 1 insertions, 10 deletions
@@ -75,15 +75,6 @@ const struct eventop epollops = { 0 }; -#ifdef _EVENT_HAVE_SETFD -#define FD_CLOSEONEXEC(x) do { \ - if (fcntl(x, F_SETFD, 1) == -1) \ - event_warn("fcntl(%d, F_SETFD)", x); \ -} while (0) -#else -#define FD_CLOSEONEXEC(x) -#endif - #define INITIAL_NEVENT 32 #define MAX_NEVENT 4096 @@ -109,7 +100,7 @@ epoll_init(struct event_base *base) return (NULL); } - FD_CLOSEONEXEC(epfd); + evutil_make_socket_closeonexec(epfd); if (!(epollop = mm_calloc(1, sizeof(struct epollop)))) return (NULL); |