Skip to content

Instantly share code, notes, and snippets.

@sailfish009
Forked from saghul/linux-pollpri.diff
Created September 26, 2016 02:31
Show Gist options
  • Save sailfish009/8711c17af3ca059a9afef6a9b85192db to your computer and use it in GitHub Desktop.
Save sailfish009/8711c17af3ca059a9afef6a9b85192db to your computer and use it in GitHub Desktop.
diff --git a/src/unix/internal.h b/src/unix/internal.h
index 03a9226..b2f1a41 100644
--- a/src/unix/internal.h
+++ b/src/unix/internal.h
@@ -86,7 +86,7 @@
#endif
#if defined(__linux__)
-# define UV__POLLIN UV__EPOLLIN
+# define UV__POLLIN (UV__EPOLLIN | UV__EPOLLPRI)
# define UV__POLLOUT UV__EPOLLOUT
# define UV__POLLERR UV__EPOLLERR
# define UV__POLLHUP UV__EPOLLHUP
diff --git a/src/unix/linux-syscalls.h b/src/unix/linux-syscalls.h
index 6f249b7..0f9c9a3 100644
--- a/src/unix/linux-syscalls.h
+++ b/src/unix/linux-syscalls.h
@@ -73,6 +73,7 @@
#define UV__EPOLL_CTL_MOD 3
#define UV__EPOLLIN 1
+#define UV__EPOLLPRI 2
#define UV__EPOLLOUT 4
#define UV__EPOLLERR 8
#define UV__EPOLLHUP 16
diff --git a/src/unix/stream.c b/src/unix/stream.c
index d41a342..161251d 100644
--- a/src/unix/stream.c
+++ b/src/unix/stream.c
@@ -483,7 +483,7 @@ void uv__server_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
int err;
stream = container_of(w, uv_stream_t, io_watcher);
- assert(events == UV__POLLIN);
+ /*assert(events == UV__POLLIN);*/
assert(stream->accepted_fd == -1);
assert(!(stream->flags & UV_CLOSING));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment