summarylogtreecommitdiffstats
path: root/0034-exit-on-idle-only-exit-if-actually-idle.patch
diff options
context:
space:
mode:
Diffstat (limited to '0034-exit-on-idle-only-exit-if-actually-idle.patch')
-rw-r--r--0034-exit-on-idle-only-exit-if-actually-idle.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/0034-exit-on-idle-only-exit-if-actually-idle.patch b/0034-exit-on-idle-only-exit-if-actually-idle.patch
new file mode 100644
index 000000000000..3a22433cea51
--- /dev/null
+++ b/0034-exit-on-idle-only-exit-if-actually-idle.patch
@@ -0,0 +1,29 @@
+From a8ba6cd15d3a5edf1f9fbb4fd08dc428c3939072 Mon Sep 17 00:00:00 2001
+From: Tom Gundersen <teg@jklm.no>
+Date: Fri, 13 Feb 2015 16:20:45 +0100
+Subject: [PATCH] exit-on-idle: only exit if actually idle
+
+sd_event_wait() returning 0 usually means that it timed out, which means it must
+have been idle. However, sd_event_wait() may return 0 in case an event was triggered
+but it turned out there was nothing to do. Make the check for idle explicit to avoid
+this edge-case.
+---
+ src/libsystemd/sd-bus/bus-util.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/libsystemd/sd-bus/bus-util.c b/src/libsystemd/sd-bus/bus-util.c
+index c9d8713..52d4ebe 100644
+--- a/src/libsystemd/sd-bus/bus-util.c
++++ b/src/libsystemd/sd-bus/bus-util.c
+@@ -123,7 +123,7 @@ int bus_event_loop_with_idle(
+ if (r < 0)
+ return r;
+
+- if (r == 0 && !exiting) {
++ if (r == 0 && !exiting && idle) {
+
+ r = sd_bus_try_close(bus);
+ if (r == -EBUSY)
+--
+2.3.0
+