diff options
Diffstat (limited to 'src/notify.c')
-rw-r--r-- | src/notify.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/notify.c b/src/notify.c index d58987470..86d5e1af1 100644 --- a/src/notify.c +++ b/src/notify.c @@ -30,18 +30,19 @@ void initNotify(Notify *notify) strerror(errno)); } -int waitNotify(Notify *notify) +void waitNotify(Notify *notify) { char buffer[64]; - ssize_t nbytes; - nbytes = read(notify->fds[0], buffer, sizeof(buffer)); - return (int)nbytes; + if (read(notify->fds[0], buffer, sizeof(buffer)) < 0) + FATAL("error reading from pipe: %s\n", strerror(errno)); } -int signalNotify(Notify *notify) +void signalNotify(Notify *notify) { - char buffer[1] = { 0 }; + char buffer; - return (int)write(notify->fds[1], &buffer, sizeof(buffer)); + if (write(notify->fds[1], &buffer, sizeof(buffer)) < 0 && + errno != EAGAIN && errno != EINTR) + FATAL("error writing to pipe: %s\n", strerror(errno)); } |