chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Handle suspend, shutdown, reboot, etc within elogind
[elogind.git]
/
src
/
login
/
inhibit.c
diff --git
a/src/login/inhibit.c
b/src/login/inhibit.c
index 1f78e4b883d565179a354da6ffe19196e6fd403e..c53ea8add7c6c1efe2da0812d1117362ce6d1a28 100644
(file)
--- a/
src/login/inhibit.c
+++ b/
src/login/inhibit.c
@@
-32,6
+32,8
@@
#include "build.h"
#include "strv.h"
#include "formats-util.h"
#include "build.h"
#include "strv.h"
#include "formats-util.h"
+#include "process-util.h"
+#include "signal-util.h"
static const char* arg_what = "idle:sleep:shutdown";
static const char* arg_who = NULL;
static const char* arg_what = "idle:sleep:shutdown";
static const char* arg_who = NULL;
@@
-221,7
+223,7
@@
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;
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;
log_parse_environment();
int r;
log_parse_environment();
@@
-273,6
+275,9
@@
int main(int argc, char *argv[]) {
if (pid == 0) {
/* Child */
if (pid == 0) {
/* Child */
+ (void) reset_all_signal_handlers();
+ (void) reset_signal_mask();
+
close_all_fds(NULL, 0);
execvp(argv[optind], argv + optind);
close_all_fds(NULL, 0);
execvp(argv[optind], argv + optind);