summaryrefslogtreecommitdiff
path: root/epoll.c
diff options
context:
space:
mode:
authorJardel Weyrich <jweyrich@gmail.com>2009-12-29 16:21:26 -0200
committerNick Mathewson <nickm@torproject.org>2009-12-29 15:12:56 -0500
commitd0939d2b971417cd5714b535dabfdbd4213b26cb (patch)
tree56537bd909fc49ee00f4c50d2a7464a9fe7aeeaf /epoll.c
parent4df7dbcbdfc9bf169f70b3e74e0a3ec824065bf3 (diff)
downloadlibevent-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.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/epoll.c b/epoll.c
index 03d4bb22..eb429a8f 100644
--- a/epoll.c
+++ b/epoll.c
@@ -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);