chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
manager: log job mode when running job
[elogind.git]
/
src
/
notify.c
diff --git
a/src/notify.c
b/src/notify.c
index 77978104a71cd9f8789927e8a757606791e14161..28cfe23b23c4d81ddeaee10ba4b07366fc44abd9 100644
(file)
--- a/
src/notify.c
+++ b/
src/notify.c
@@
-1,4
+1,4
@@
-/*-*- Mode: C; c-basic-offset: 8 -*-*/
+/*-*- Mode: C; c-basic-offset: 8
; indent-tabs-mode: nil
-*-*/
/***
This file is part of systemd.
/***
This file is part of systemd.
@@
-39,7
+39,7
@@
static bool arg_booted = false;
static int help(void) {
static int help(void) {
- printf("%s [
options
] [VARIABLE=VALUE...]\n\n"
+ printf("%s [
OPTIONS...
] [VARIABLE=VALUE...]\n\n"
"Notify the init system about service status updates.\n\n"
" -h --help Show this help\n"
" --ready Inform the init system about service start-up completion\n"
"Notify the init system about service status updates.\n\n"
" -h --help Show this help\n"
" --ready Inform the init system about service start-up completion\n"
@@
-115,6
+115,15
@@
static int parse_argv(int argc, char *argv[]) {
}
}
}
}
+ if (optind >= argc &&
+ !arg_ready &&
+ !arg_status &&
+ !arg_pid &&
+ !arg_booted) {
+ help();
+ return -EINVAL;
+ }
+
return 1;
}
return 1;
}
@@
-122,12
+131,13
@@
int main(int argc, char* argv[]) {
char* our_env[4], **final_env = NULL;
unsigned i = 0;
char *status = NULL, *cpid = NULL, *n = NULL;
char* our_env[4], **final_env = NULL;
unsigned i = 0;
char *status = NULL, *cpid = NULL, *n = NULL;
- int r, retval =
1
;
+ int r, retval =
EXIT_FAILURE
;
log_parse_environment();
log_parse_environment();
+ log_open();
if ((r = parse_argv(argc, argv)) <= 0) {
if ((r = parse_argv(argc, argv)) <= 0) {
- retval = r < 0;
+ retval = r < 0
? EXIT_FAILURE : EXIT_SUCCESS
;
goto finish;
}
goto finish;
}
@@
-163,7
+173,7
@@
int main(int argc, char* argv[]) {
}
if (strv_length(final_env) <= 0) {
}
if (strv_length(final_env) <= 0) {
- retval =
0
;
+ retval =
EXIT_SUCCESS
;
goto finish;
}
goto finish;
}
@@
-177,7
+187,7
@@
int main(int argc, char* argv[]) {
goto finish;
}
goto finish;
}
- retval = r <= 0;
+ retval = r <= 0
? EXIT_FAILURE : EXIT_SUCCESS
;
finish:
free(status);
finish:
free(status);