if (getppid() != 1) {
log_error("This program should be invoked by init only.");
- return 1;
+ return EXIT_FAILURE;
}
if (argc != 2) {
log_error("This program requires one argument.");
- return 1;
+ return EXIT_FAILURE;
}
log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
#endif
if (c.bus) {
- dbus_connection_close(c.bus);
- dbus_connection_unref(c.bus);
+ dbus_connection_flush(c.bus);
+ dbus_connection_close(c.bus);
+ dbus_connection_unref(c.bus);
}
dbus_error_free(&error);
dbus_shutdown();
- return r < 0 ? 1 : 0;
+ return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}