Einige CGI Fixes

git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@643 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
maniacikarus
2007-06-21 18:14:48 +00:00
parent cde0e11690
commit fe6cda9204
5 changed files with 28 additions and 18 deletions

View File

@@ -279,14 +279,16 @@ int main(int argc, char *argv[]) {
if (!(initsetuid()))
exit(1);
FILE *file = NULL;
/* Get vpnwatch pid */
int fd;
if (( fd = open("/var/run/vpn-watch.pid", O_RDONLY)) != "" ) {
close(fd);
safe_system("kill -9 $(cat /var/run/vpn-watch.pid)");
if (file = fopen("/var/run/vpn-watch.pid", "r")) {
safe_system("kill -9 fd");
safe_system("unlink /var/run/vpn-watch.pid)");
}
close(fd);
/* FIXME: workaround for pclose() issue - still no real idea why
* this is happening */
signal(SIGCHLD, SIG_DFL);
@@ -356,7 +358,6 @@ int main(int argc, char *argv[]) {
char if_orange[STRING_SIZE] = "";
char if_blue[STRING_SIZE] = "";
char s[STRING_SIZE];
FILE *file = NULL;
if (!(file = fopen(CONFIG_ROOT "/vpn/config", "r"))) {
fprintf(stderr, "Couldn't open vpn settings file");