chiark / gitweb /
event: when we change the io events to watch we need to figure out if a an event...
[elogind.git] / src / libsystemd-bus / sd-event.c
index 5cb3bccc5aecc08e392f9b6221cbc19369b36a43..55a85460893443095f9e6c60386040c5d6fe49e8 100644 (file)
@@ -234,7 +234,7 @@ static int earliest_time_prioq_compare(const void *a, const void *b) {
         if (x->time.next < y->time.next)
                 return -1;
         if (x->time.next > y->time.next)
-                return -1;
+                return 1;
 
         /* Stability for the rest */
         if (x < y)
@@ -267,7 +267,7 @@ static int latest_time_prioq_compare(const void *a, const void *b) {
         if (x->time.next + x->time.accuracy < y->time.next + y->time.accuracy)
                 return -1;
         if (x->time.next + x->time.accuracy > y->time.next + y->time.accuracy)
-                return -1;
+                return 1;
 
         /* Stability for the rest */
         if (x < y)
@@ -1027,6 +1027,7 @@ _public_ int sd_event_source_set_io_events(sd_event_source *s, uint32_t events)
         }
 
         s->io.events = events;
+        source_set_pending(s, false);
 
         return 0;
 }