diff options
author | Elliott Hughes <enh@google.com> | 2014-09-23 22:56:38 +0200 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-23 22:56:38 +0200 |
commit | 632bf8668a53a55d85ea982f2875d1f3b47d3d5a (patch) | |
tree | 77acb4ca27611196a6a47c9c6ed9d2bb47244ab9 | |
parent | Use the correct fuse_init_out structure size. (diff) | |
parent | am 530b61e0: Merge "Copy epoll(2) changes to minadb." (diff) | |
download | android_bootable_recovery-632bf8668a53a55d85ea982f2875d1f3b47d3d5a.tar android_bootable_recovery-632bf8668a53a55d85ea982f2875d1f3b47d3d5a.tar.gz android_bootable_recovery-632bf8668a53a55d85ea982f2875d1f3b47d3d5a.tar.bz2 android_bootable_recovery-632bf8668a53a55d85ea982f2875d1f3b47d3d5a.tar.lz android_bootable_recovery-632bf8668a53a55d85ea982f2875d1f3b47d3d5a.tar.xz android_bootable_recovery-632bf8668a53a55d85ea982f2875d1f3b47d3d5a.tar.zst android_bootable_recovery-632bf8668a53a55d85ea982f2875d1f3b47d3d5a.zip |
-rw-r--r-- | minadbd/fdevent.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/minadbd/fdevent.c b/minadbd/fdevent.c index 5c374a71b..b62781753 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) |