diff options
author | Christian Pointner <equinox@spreadspace.org> | 2016-05-25 22:54:21 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2016-05-25 22:54:21 +0200 |
commit | 0c4e68d5afb47b2e378cf782f289c328c05a11d3 (patch) | |
tree | bb761f3e6509bd52fcecf58ec4a6c5d3dfa4e37f /src/sysexec.c | |
parent | updated copyright info (diff) |
major cleanup and refactoring
Diffstat (limited to 'src/sysexec.c')
-rw-r--r-- | src/sysexec.c | 5 |
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]); |