chiark / gitweb /
sd-event: return 1 in sd_event_run() when we hit EINTR
authorLennart Poettering <lennart@poettering.net>
Thu, 19 Dec 2013 20:38:52 +0000 (21:38 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 19 Dec 2013 21:18:39 +0000 (22:18 +0100)
That way we can distuingish timeouts from EINTR

src/libsystemd-bus/sd-event.c

index 727528bb3cc84e839e3c180d1812497165c159ec..a1baac52aaaa324a5b372d05583d30293ad18502 100644 (file)
@@ -1986,7 +1986,7 @@ _public_ int sd_event_run(sd_event *e, uint64_t timeout) {
         m = epoll_wait(e->epoll_fd, ev_queue, ev_queue_max,
                        timeout == (uint64_t) -1 ? -1 : (int) ((timeout + USEC_PER_MSEC - 1) / USEC_PER_MSEC));
         if (m < 0) {
-                r = errno == EAGAIN || errno == EINTR ? 0 : -errno;
+                r = errno == EAGAIN || errno == EINTR ? 1 : -errno;
                 goto finish;
         }