mirror of
https://github.com/troglobit/libuev.git
synced 2026-11-06 15:50:52 +00:00
redirect: Update example to handle new failure mode
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
71e6d78fdc
commit
ddfc1460eb
1 file changed
+3
@@ -24,6 +24,9 @@ void process_stdin(uev_t *w, void *arg, int events)
|
||||
char buf[256];
|
||||
int len;
|
||||
|
||||
if (UEV_ERROR == events)
|
||||
errx(EBADF, "Unrecoverable error, exiting");
|
||||
|
||||
len = read(w->fd, buf, sizeof(buf));
|
||||
if (len == -1) {
|
||||
warn("Error reading from stdin");
|
||||
|
||||
Reference in new issue
Block a user