chiark / gitweb /
service: properly handle if the main process is down and we wait for the cgroup to...
[elogind.git] / src / cgroups-agent.c
index af458b25e49963c154b7f78accee9e24504e6fc5..30aeede943d553491422fadaed7752d755209b95 100644 (file)
@@ -21,6 +21,8 @@
 
 #include <dbus/dbus.h>
 
+#include <stdlib.h>
+
 #include "log.h"
 #include "dbus-common.h"
 
@@ -28,7 +30,7 @@ int main(int argc, char *argv[]) {
         DBusError error;
         DBusConnection *bus = NULL;
         DBusMessage *m = NULL;
-        int r = 1;
+        int r = EXIT_FAILURE;
 
         dbus_error_init(&error);
 
@@ -76,10 +78,11 @@ int main(int argc, char *argv[]) {
                 goto finish;
         }
 
-        r = 0;
+        r = EXIT_SUCCESS;
 
 finish:
         if (bus) {
+                dbus_connection_flush(bus);
                 dbus_connection_close(bus);
                 dbus_connection_unref(bus);
         }