mirror of
https://github.com/troglobit/libuev.git
synced 2026-11-19 19:51:06 +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];
|
char buf[256];
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
|
if (UEV_ERROR == events)
|
||||||
|
errx(EBADF, "Unrecoverable error, exiting");
|
||||||
|
|
||||||
len = read(w->fd, buf, sizeof(buf));
|
len = read(w->fd, buf, sizeof(buf));
|
||||||
if (len == -1) {
|
if (len == -1) {
|
||||||
warn("Error reading from stdin");
|
warn("Error reading from stdin");
|
||||||
|
|||||||
Reference in new issue
Block a user