chiark / gitweb /
path_check_timestamp: only keep the most recent timestamp
[elogind.git] / src / libsystemd-bus / sd-event.c
index dd8d3ee629214c7fb18d1c7a7a0b9e4fa5d254e8..b3a6c5b08ae845aed532723c60aec8590ce8b1c9 100644 (file)
@@ -1430,15 +1430,6 @@ static int process_io(sd_event *e, sd_event_source *s, uint32_t events) {
 
         s->io.revents = events;
 
-        /*
-           If this is a oneshot event source, then we added it to the
-           epoll with EPOLLONESHOT, hence we know it's not registered
-           anymore. We can save a syscall here...
-        */
-
-        if (s->enabled == SD_EVENT_ONESHOT)
-                s->io.registered = false;
-
         return source_set_pending(s, true);
 }
 
@@ -1594,7 +1585,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 +1739,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;
         }