summaryrefslogtreecommitdiff
path: root/src/sysexec.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sysexec.c')
-rw-r--r--src/sysexec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sysexec.c b/src/sysexec.c
index 1e50e53..c248ec6 100644
--- a/src/sysexec.c
+++ b/src/sysexec.c
@@ -25,6 +25,7 @@
#include "datatypes.h"
+#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -32,6 +33,7 @@
#include <sys/wait.h>
#include <sys/select.h>
#include <stdlib.h>
+#include <stdio.h>
#include <string.h>
#include "sysexec.h"
@@ -172,7 +174,8 @@ child_t* rh_exec(const char* script, char* const argv[], char* const evp[])
// if execve returns, an error occurred, but logging doesn't work
// because we closed all file descriptors, so just write errno to
// pipe and call exit
- write(pipefd[1], (void*)(&errno), sizeof(errno));
+ int ret = write(pipefd[1], (void*)(&errno), sizeof(errno));
+ if(ret == -1) exit(-1);
exit(-1);
}
close(pipefd[1]);