chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
service: properly handle if the main process is down and we wait for the cgroup to...
[elogind.git]
/
src
/
cgroups-agent.c
diff --git
a/src/cgroups-agent.c
b/src/cgroups-agent.c
index 92b56c5fbd7f080c37f33a6abf033002ca870f95..30aeede943d553491422fadaed7752d755209b95 100644
(file)
--- a/
src/cgroups-agent.c
+++ b/
src/cgroups-agent.c
@@
-21,6
+21,8
@@
#include <dbus/dbus.h>
#include <dbus/dbus.h>
+#include <stdlib.h>
+
#include "log.h"
#include "dbus-common.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;
DBusError error;
DBusConnection *bus = NULL;
DBusMessage *m = NULL;
- int r =
1
;
+ int r =
EXIT_FAILURE
;
dbus_error_init(&error);
dbus_error_init(&error);
@@
-49,7
+51,7
@@
int main(int argc, char *argv[]) {
dbus_error_free(&error);
if (!(bus = dbus_connection_open_private("unix:abstract=/org/freedesktop/systemd1/private", &error))) {
dbus_error_free(&error);
if (!(bus = dbus_connection_open_private("unix:abstract=/org/freedesktop/systemd1/private", &error))) {
- log_error("Failed to get D-Bus connection: %s",
error.message
);
+ log_error("Failed to get D-Bus connection: %s",
bus_error_message(&error)
);
goto finish;
}
goto finish;
}
@@
-76,10
+78,11
@@
int main(int argc, char *argv[]) {
goto finish;
}
goto finish;
}
- r =
0
;
+ r =
EXIT_SUCCESS
;
finish:
if (bus) {
finish:
if (bus) {
+ dbus_connection_flush(bus);
dbus_connection_close(bus);
dbus_connection_unref(bus);
}
dbus_connection_close(bus);
dbus_connection_unref(bus);
}