event: handle arbitrary signals received during epoll gracefully
authorLennart Poettering <lennart@poettering.net>
Wed, 16 Oct 2013 03:57:41 +0000 (05:57 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 16 Oct 2013 04:15:00 +0000 (06:15 +0200)
src/libsystemd-bus/sd-event.c

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