X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=x5%2Fkhatus.c;h=0ecac5afd4adb25055c3de5f5ba85528194a911f;hb=55883d9a0ab2ca4956bda685c219557f8bd940f1;hp=6ffa538339d005138ac8b5e0cd3c9d59cb7c092d;hpb=716cc2b4b0f4aa2e92b0bc75220128a49cd0921a;p=khatus.git diff --git a/x5/khatus.c b/x5/khatus.c index 6ffa538..0ecac5a 100644 --- a/x5/khatus.c +++ b/x5/khatus.c @@ -429,8 +429,19 @@ fifo_read_all(Config *cfg, struct timespec *ti, char *buf) debug("selecting...\n"); ready = pselect(maxfd + 1, &fds, NULL, NULL, ti, NULL); debug("ready: %d\n", ready); - assert(ready >= 0); clock_gettime(CLOCK_MONOTONIC, &t); + if (ready == -1) { + switch (errno) { + case EINTR: + error("pselect temp failure: %d, errno: %d, msg: %s\n", + ready, errno, strerror(errno)); + /* TODO: Reconsider what to do here. */ + return; + default: + fatal("pselect failed: %d, errno: %d, msg: %s\n", + ready, errno, strerror(errno)); + } + } /* At-least-once ensures that expiries are still checked on timeouts. */ do { for (Fifo *f = cfg->fifos; f; f = f->next) {