diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-05-31 23:55:55 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-03-14 10:01:17 +0100 |
commit | a60149bda6fb245c1ed2422a92027a7a0b1b40de (patch) | |
tree | 04550e92a3bca17338d654ab9276b71095cecbce /src/login | |
parent | 5359a35808adfc37bd7fba849daee45da6a60a71 (diff) |
tree-wide: whenever we fork off a foreign child process reset signal mask/handlers
Also, when the child is potentially long-running make sure to set a
death signal.
Also, ignore the result of the reset operations explicitly by casting
them to (void).
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/inhibit.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/login/inhibit.c b/src/login/inhibit.c index 1f78e4b88..0e5dce592 100644 --- 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 "process-util.h" +#include "signal-util.h" static const char* arg_what = "idle:sleep:shutdown"; static const char* arg_who = NULL; @@ -273,6 +275,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); |