summaryrefslogtreecommitdiff
path: root/src/sysexec.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2012-09-25 11:45:31 +0000
committerChristian Pointner <equinox@anytun.org>2012-09-25 11:45:31 +0000
commit4dda2b162fdab27197f371bb85842da581aee834 (patch)
treef0b10a52e541160c1739444923066c83e1c491ff /src/sysexec.c
parentconfigure script cleanup (diff)
-Wall cleanup
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 1d3df91..708d8d0 100644
--- a/src/sysexec.c
+++ b/src/sysexec.c
@@ -35,6 +35,7 @@
#include "datatypes.h"
+#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -42,6 +43,7 @@
#include <sys/wait.h>
#include <sys/select.h>
#include <stdlib.h>
+#include <stdio.h>
#include <string.h>
#include "sysexec.h"
@@ -83,7 +85,8 @@ int uanytun_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]);