diff options
author | Stefan Metzmacher <metze@samba.org> | 2020-02-26 16:36:30 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2020-02-26 19:45:36 +0000 |
commit | 6d63fa024668d1f02fee0fa6b309497703be6a96 (patch) | |
tree | f2de0f54c5313a3d7a730fc0996d94c2e6ab263e /lib/tsocket | |
parent | aab5c8470f72f601b4185bb49d5539c4f29b3cd8 (diff) | |
download | samba-6d63fa024668d1f02fee0fa6b309497703be6a96.tar.gz |
lib/tsocket: add a comment regarding TEVENT_FD_READ in tstream_bsd_connect_send()
This is different compared to the raw usage of [e]poll
where [E]POLLOUT is enough to see errors via POLLERR/POLLHUP.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/tsocket')
-rw-r--r-- | lib/tsocket/tsocket_bsd.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/tsocket/tsocket_bsd.c b/lib/tsocket/tsocket_bsd.c index 1627051f3ec..6ad40bd0ada 100644 --- a/lib/tsocket/tsocket_bsd.c +++ b/lib/tsocket/tsocket_bsd.c @@ -2341,6 +2341,14 @@ static struct tevent_req *tstream_bsd_connect_send(TALLOC_CTX *mem_ctx, goto post; async: + + /* + * Note for historic reasons TEVENT_FD_WRITE is not enough + * to get notified for POLLERR or EPOLLHUP even if they + * come together with POLLOUT. That means we need to + * use TEVENT_FD_READ in addition until we have + * TEVENT_FD_ERROR. + */ state->fde = tevent_add_fd(ev, state, state->fd, TEVENT_FD_READ | TEVENT_FD_WRITE, |