aboutsummaryrefslogtreecommitdiffstats
path: root/minadbd
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-09-23 18:36:33 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-09-23 18:36:34 +0000
commit530b61e0b5f154e5f38853c10a28e0ea6f41c2ca (patch)
tree13899f61be3fb2bdaf065d8fb3129ba9b8f8b23a /minadbd
parent974fe112ae6df95ca6d49688d6e3e459d87e16de (diff)
parentdb8c959049d21fe63e48c270f1fc12b32a0cf0ec (diff)
downloadbootable_recovery-530b61e0b5f154e5f38853c10a28e0ea6f41c2ca.zip
bootable_recovery-530b61e0b5f154e5f38853c10a28e0ea6f41c2ca.tar.gz
bootable_recovery-530b61e0b5f154e5f38853c10a28e0ea6f41c2ca.tar.bz2
Merge "Copy epoll(2) changes to minadb."
Diffstat (limited to 'minadbd')
-rw-r--r--minadbd/fdevent.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/minadbd/fdevent.c b/minadbd/fdevent.c
index 5c374a7..b627817 100644
--- a/minadbd/fdevent.c
+++ b/minadbd/fdevent.c
@@ -102,8 +102,7 @@ static fdevent list_pending = {
static fdevent **fd_table = 0;
static int fd_table_max = 0;
-#ifdef CRAPTASTIC
-//HAVE_EPOLL
+#ifdef __linux__
#include <sys/epoll.h>
@@ -111,32 +110,16 @@ static int epoll_fd = -1;
static void fdevent_init()
{
- /* XXX: what's a good size for the passed in hint? */
- epoll_fd = epoll_create(256);
-
- if(epoll_fd < 0) {
+ epoll_fd = epoll_create1(EPOLL_CLOEXEC);
+ if(epoll_fd == -1) {
perror("epoll_create() failed");
exit(1);
}
-
- /* mark for close-on-exec */
- fcntl(epoll_fd, F_SETFD, FD_CLOEXEC);
}
static void fdevent_connect(fdevent *fde)
{
- struct epoll_event ev;
-
- memset(&ev, 0, sizeof(ev));
- ev.events = 0;
- ev.data.ptr = fde;
-
-#if 0
- if(epoll_ctl(epoll_fd, EPOLL_CTL_ADD, fde->fd, &ev)) {
- perror("epoll_ctl() failed\n");
- exit(1);
- }
-#endif
+ // Nothing to do here. fdevent_update will handle the EPOLL_CTL_ADD.
}
static void fdevent_disconnect(fdevent *fde)