summaryrefslogtreecommitdiff
path: root/src/vconsole/vconsole-setup.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-05-31 23:55:55 +0200
committerLennart Poettering <lennart@poettering.net>2015-06-10 01:28:58 +0200
commitce30c8dcb41dfe9264f79f30c7f51c0e74576638 (patch)
tree2d5c05e1225b43ec3d9870316899c1e87f7f381d /src/vconsole/vconsole-setup.c
parent0c2c2a3aeb4c348e41d5d634c397faa3aa35cba7 (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/vconsole/vconsole-setup.c')
-rw-r--r--src/vconsole/vconsole-setup.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c
index 6c782b3130..f7728dcfff 100644
--- a/src/vconsole/vconsole-setup.c
+++ b/src/vconsole/vconsole-setup.c
@@ -37,6 +37,7 @@
#include "fileio.h"
#include "process-util.h"
#include "terminal-util.h"
+#include "signal-util.h"
static bool is_vconsole(int fd) {
unsigned char data[1];
@@ -122,6 +123,10 @@ static int keyboard_load_and_wait(const char *vc, const char *map, const char *m
if (pid < 0)
return log_error_errno(errno, "Failed to fork: %m");
else if (pid == 0) {
+
+ (void) reset_all_signal_handlers();
+ (void) reset_signal_mask();
+
execv(args[0], (char **) args);
_exit(EXIT_FAILURE);
}
@@ -160,6 +165,10 @@ static int font_load_and_wait(const char *vc, const char *font, const char *map,
if (pid < 0)
return log_error_errno(errno, "Failed to fork: %m");
else if (pid == 0) {
+
+ (void) reset_all_signal_handlers();
+ (void) reset_signal_mask();
+
execv(args[0], (char **) args);
_exit(EXIT_FAILURE);
}