summaryrefslogtreecommitdiff
path: root/src/sysexec.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2009-06-24 01:46:33 +0000
committerChristian Pointner <equinox@anytun.org>2009-06-24 01:46:33 +0000
commit9103e8e13f7dcfc0177d0202895185b442db8bc3 (patch)
treeb3e6a1d8e620f58896a8845b33bdbf6812eba0e2 /src/sysexec.c
parentbsd tun device now also uses uanytun_exec (diff)
fixed ifconfig calls for linux and bsd
fixed execve error handling
Diffstat (limited to 'src/sysexec.c')
-rw-r--r--src/sysexec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sysexec.c b/src/sysexec.c
index 2ef1d50..5cedbf7 100644
--- a/src/sysexec.c
+++ b/src/sysexec.c
@@ -65,9 +65,9 @@ int uanytun_exec(const char* script, char* const argv[], char* const evp[])
log_printf(WARNING, "can't open stderr");
}
execve(script, argv, evp);
- // if execl return, an error occurred
- log_printf(ERROR, "error on executing script: %s", strerror(errno));
- return -1;
+ // if execve returns, an error occurred, but logging doesn't work
+ // because we closed all file descriptors, so just call exit
+ exit(-1);
}
int status = 0;
waitpid(pid, &status, 0);