summaryrefslogtreecommitdiff
path: root/src/sysexec.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sysexec.c')
-rw-r--r--src/sysexec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sysexec.c b/src/sysexec.c
index e7b17e1..d4edc4b 100644
--- a/src/sysexec.c
+++ b/src/sysexec.c
@@ -24,6 +24,7 @@
#include "datatypes.h"
+#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -171,7 +172,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 len = write(pipefd[1], (void*)(&errno), sizeof(errno));
+ if(len) exit(-1);
exit(-1);
}
close(pipefd[1]);