X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Flogin%2Finhibit.c;h=a8328592fcfd83c4911d0eacca906dfce9533c3d;hp=1f78e4b883d565179a354da6ffe19196e6fd403e;hb=94c5f7fa9e34517edad75cd63d71dd459ec4f133;hpb=01c94c5d0aff09b4c0e429d483c8eeba40017071
diff --git a/src/login/inhibit.c b/src/login/inhibit.c
index 1f78e4b88..a8328592f 100644
--- a/src/login/inhibit.c
+++ b/src/login/inhibit.c
@@ -19,19 +19,27 @@
along with systemd; If not, see .
***/
+#include
#include
-#include
#include
+#include
#include
-#include
#include "sd-bus.h"
-#include "bus-util.h"
+
+#include "alloc-util.h"
#include "bus-error.h"
-#include "util.h"
-#include "build.h"
-#include "strv.h"
+#include "bus-util.h"
+#include "fd-util.h"
#include "formats-util.h"
+#include "process-util.h"
+#include "signal-util.h"
+#include "strv.h"
+#include "user-util.h"
+#include "util.h"
+
+/// Additional includes needed by elogind
+#include "musl_missing.h"
static const char* arg_what = "idle:sleep:shutdown";
static const char* arg_who = NULL;
@@ -177,9 +185,7 @@ static int parse_argv(int argc, char *argv[]) {
return 0;
case ARG_VERSION:
- puts(PACKAGE_STRING);
- puts(SYSTEMD_FEATURES);
- return 0;
+ return version();
case ARG_WHAT:
arg_what = optarg;
@@ -221,9 +227,10 @@ static int parse_argv(int argc, char *argv[]) {
int main(int argc, char *argv[]) {
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
- _cleanup_bus_close_unref_ sd_bus *bus = NULL;
+ _cleanup_bus_flush_close_unref_ sd_bus *bus = NULL;
int r;
+ elogind_set_program_name(argv[0]);
log_parse_environment();
log_open();
@@ -273,6 +280,9 @@ int main(int argc, char *argv[]) {
if (pid == 0) {
/* Child */
+ (void) reset_all_signal_handlers();
+ (void) reset_signal_mask();
+
close_all_fds(NULL, 0);
execvp(argv[optind], argv + optind);