Make sure to restart the I/O watcher on UEV_ERROR

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-11-14 12:17:41 +01:00
1 parent ebb574136b
commit d52254b4ec
2 files changed
+12 -6

No files matched your search

+4 -2
View File
@@ -24,8 +24,10 @@ void process_stdin(uev_t *w, void *arg, int events)
char buf[256];
int len;
if (UEV_ERROR == events)
errx(EBADF, "Unrecoverable error, exiting");
if (UEV_ERROR == events) {
warnx("Spurious problem with the stdin watcher, restarting.");
uev_io_start(w);
}
len = read(w->fd, buf, sizeof(buf));
if (len == -1) {