chiark / gitweb /
log: avoid calling the logging functions for log levels above the current maximum
[elogind.git] / src / libsystemd-bus / sd-event.c
index dd8d3ee629214c7fb18d1c7a7a0b9e4fa5d254e8..19fa982ed391356784eeebc5ac669fe8f11173d2 100644 (file)
@@ -1594,7 +1594,7 @@ static int process_signal(sd_event *e, uint32_t events) {
 }
 
 static int source_dispatch(sd_event_source *s) {
-        int r;
+        int r = 0;
 
         assert(s);
         assert(s->pending || s->type == SOURCE_QUIT);
@@ -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;
         }