diff options
author | thegeorg <thegeorg@yandex-team.ru> | 2022-02-10 16:45:12 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:12 +0300 |
commit | 49116032d905455a7b1c994e4a696afc885c1e71 (patch) | |
tree | be835aa92c6248212e705f25388ebafcf84bc7a1 /contrib/libs/libevent/poll.c | |
parent | 4e839db24a3bbc9f1c610c43d6faaaa99824dcca (diff) | |
download | ydb-49116032d905455a7b1c994e4a696afc885c1e71.tar.gz |
Restoring authorship annotation for <thegeorg@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/libevent/poll.c')
-rw-r--r-- | contrib/libs/libevent/poll.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/contrib/libs/libevent/poll.c b/contrib/libs/libevent/poll.c index 67f96695f4..c3c9aac52a 100644 --- a/contrib/libs/libevent/poll.c +++ b/contrib/libs/libevent/poll.c @@ -53,17 +53,17 @@ #include "evthread-internal.h" #include "time-internal.h" -/* Since Linux 2.6.17, poll is able to report about peer half-closed connection - using special POLLRDHUP flag on a read event. -*/ -#if !defined(POLLRDHUP) -#define POLLRDHUP 0 -#define EARLY_CLOSE_IF_HAVE_RDHUP 0 -#else -#define EARLY_CLOSE_IF_HAVE_RDHUP EV_FEATURE_EARLY_CLOSE -#endif - - +/* Since Linux 2.6.17, poll is able to report about peer half-closed connection + using special POLLRDHUP flag on a read event. +*/ +#if !defined(POLLRDHUP) +#define POLLRDHUP 0 +#define EARLY_CLOSE_IF_HAVE_RDHUP 0 +#else +#define EARLY_CLOSE_IF_HAVE_RDHUP EV_FEATURE_EARLY_CLOSE +#endif + + struct pollidx { int idxplus1; }; @@ -90,8 +90,8 @@ const struct eventop pollops = { poll_del, poll_dispatch, poll_dealloc, - 1, /* need_reinit */ - EV_FEATURE_FDS|EARLY_CLOSE_IF_HAVE_RDHUP, + 1, /* need_reinit */ + EV_FEATURE_FDS|EARLY_CLOSE_IF_HAVE_RDHUP, sizeof(struct pollidx), }; @@ -215,8 +215,8 @@ poll_dispatch(struct event_base *base, struct timeval *tv) res |= EV_READ; if (what & POLLOUT) res |= EV_WRITE; - if (what & POLLRDHUP) - res |= EV_CLOSED; + if (what & POLLRDHUP) + res |= EV_CLOSED; if (res == 0) continue; @@ -235,7 +235,7 @@ poll_add(struct event_base *base, int fd, short old, short events, void *idx_) int i; EVUTIL_ASSERT((events & EV_SIGNAL) == 0); - if (!(events & (EV_READ|EV_WRITE|EV_CLOSED))) + if (!(events & (EV_READ|EV_WRITE|EV_CLOSED))) return (0); poll_check_ok(pop); @@ -278,8 +278,8 @@ poll_add(struct event_base *base, int fd, short old, short events, void *idx_) pfd->events |= POLLOUT; if (events & EV_READ) pfd->events |= POLLIN; - if (events & EV_CLOSED) - pfd->events |= POLLRDHUP; + if (events & EV_CLOSED) + pfd->events |= POLLRDHUP; poll_check_ok(pop); return (0); @@ -298,7 +298,7 @@ poll_del(struct event_base *base, int fd, short old, short events, void *idx_) int i; EVUTIL_ASSERT((events & EV_SIGNAL) == 0); - if (!(events & (EV_READ|EV_WRITE|EV_CLOSED))) + if (!(events & (EV_READ|EV_WRITE|EV_CLOSED))) return (0); poll_check_ok(pop); @@ -312,8 +312,8 @@ poll_del(struct event_base *base, int fd, short old, short events, void *idx_) pfd->events &= ~POLLIN; if (events & EV_WRITE) pfd->events &= ~POLLOUT; - if (events & EV_CLOSED) - pfd->events &= ~POLLRDHUP; + if (events & EV_CLOSED) + pfd->events &= ~POLLRDHUP; poll_check_ok(pop); if (pfd->events) /* Another event cares about that fd. */ |