From 52017c3919aa9f9573cea226b0be45f0947e893f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 23 May 2014 03:03:37 +0200 Subject: shell: ensure the signal mask is restored if shell_command_do_exec fails --- src/shell.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.2.3