mirror of
https://github.com/troglobit/libuev.git
synced 2026-10-28 11:50:42 +00:00
Handle UEV_HUP properly in examples and unit tests
If an I/O watcher callback fails to read(), returning zero, we check events for UEV_HUP to detect EOF or socket remote end shutdown(). Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
d52254b4ec
commit
2bea4192db
3 files changed
+21
-7
No files matched your search
+1
-1
@@ -35,7 +35,7 @@ void process_stdin(uev_t *w, void *arg, int events)
|
||||
return;
|
||||
}
|
||||
|
||||
if (len == 0) {
|
||||
if (len == 0 || UEV_HUP == events) {
|
||||
warnx("Connection closed.");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user