mirror of
https://github.com/troglobit/libuev.git
synced 2026-10-01 05:22:25 +07:00
redirect: Update example to handle new failure mode
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -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