aboutsummaryrefslogtreecommitdiffstats
path: root/minadbd
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2014-09-25 15:12:19 -0700
committerDan Albert <danalbert@google.com>2014-09-25 15:12:19 -0700
commitf420f8eb6327a69954b8565d000060133439c39e (patch)
tree8e161f6b96fdbecabb389b35aaa9e2acc7fe6501 /minadbd
parent530b61e0b5f154e5f38853c10a28e0ea6f41c2ca (diff)
downloadbootable_recovery-f420f8eb6327a69954b8565d000060133439c39e.zip
bootable_recovery-f420f8eb6327a69954b8565d000060133439c39e.tar.gz
bootable_recovery-f420f8eb6327a69954b8565d000060133439c39e.tar.bz2
Revert "Copy epoll(2) changes to minadb."
This reverts commit db8c959049d21fe63e48c270f1fc12b32a0cf0ec.
Diffstat (limited to 'minadbd')
-rw-r--r--minadbd/fdevent.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/minadbd/fdevent.c b/minadbd/fdevent.c
index b627817..5c374a7 100644
--- a/minadbd/fdevent.c
+++ b/minadbd/fdevent.c
@@ -102,7 +102,8 @@ static fdevent list_pending = {
static fdevent **fd_table = 0;
static int fd_table_max = 0;
-#ifdef __linux__
+#ifdef CRAPTASTIC
+//HAVE_EPOLL
#include <sys/epoll.h>
@@ -110,16 +111,32 @@ static int epoll_fd = -1;
static void fdevent_init()
{
- epoll_fd = epoll_create1(EPOLL_CLOEXEC);
- if(epoll_fd == -1) {
+ /* XXX: what's a good size for the passed in hint? */
+ epoll_fd = epoll_create(256);
+
+ if(epoll_fd < 0) {
perror("epoll_create() failed");
exit(1);
}
+
+ /* mark for close-on-exec */
+ fcntl(epoll_fd, F_SETFD, FD_CLOEXEC);
}
static void fdevent_connect(fdevent *fde)
{
- // Nothing to do here. fdevent_update will handle the EPOLL_CTL_ADD.
+ 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
}
static void fdevent_disconnect(fdevent *fde)