summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-05-23 03:03:37 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-05-23 03:03:37 +0200
commit52017c3919aa9f9573cea226b0be45f0947e893f (patch)
tree331b3303a6b63f1776911d1f7c8ad6fdf73e5735 /src
parentd899fca42570d53c714d7656f628551939a2ac0c (diff)
downloadfastd-52017c3919aa9f9573cea226b0be45f0947e893f.tar
fastd-52017c3919aa9f9573cea226b0be45f0947e893f.zip
shell: ensure the signal mask is restored if shell_command_do_exec fails
Diffstat (limited to 'src')
-rw-r--r--src/shell.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/shell.c b/src/shell.c
index 2be7f82..24497f9 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -145,8 +145,10 @@ bool fastd_shell_command_exec_sync(const fastd_shell_command_t *command, const f
pthread_sigmask(SIG_BLOCK, &set, &oldset);
pid_t pid;
- if (!shell_command_do_exec(command, env, &pid))
+ if (!shell_command_do_exec(command, env, &pid)) {
+ pthread_sigmask(SIG_SETMASK, &oldset, NULL);
return false;
+ }
int status;
pid_t err = waitpid(pid, &status, 0);