summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/signal-safe.hpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/signal-safe.hpp b/src/signal-safe.hpp
index 22c825db..70320ad1 100644
--- a/src/signal-safe.hpp
+++ b/src/signal-safe.hpp
@@ -109,8 +109,10 @@ class BufFileWriter {
struct sigaction act;
act.sa_handler = SIG_DFL;
sigemptyset(&act.sa_mask);
- act.sa_flags = SA_NOCLDWAIT;
+ act.sa_flags = SA_NOCLDWAIT;
+#ifdef SA_RESTORER
act.sa_restorer = NULL;
+#endif
sigaction(SIGCHLD, &act, NULL);
}
pid_t pid = fork();
@@ -123,7 +125,7 @@ class BufFileWriter {
if (pid == 0) {
close(pipefd[0]);
dup2(pipefd[1], STDOUT_FILENO);
- char const* const argv[] = {"/bin/sh", "-c", cmd};
+ char const* const argv[] = {"/bin/sh", "-c", cmd, NULL};
execv("/bin/sh", (char* const*)argv);
BufFileWriter<64> failmsg(pipefd[1]);