redirect: Update example to handle new failure mode

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2017-11-11 13:59:05 +01:00
parent 71e6d78fdc
commit ddfc1460eb
+3
View File
@@ -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");