From: pk910 Date: Sat, 5 Nov 2011 06:01:15 +0000 (+0100) Subject: made cmd_extscript WIN32 compatible X-Git-Tag: v5.3~201 X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=commitdiff_plain;h=14085e0d6c1baf9ba478cd5d436a59b2f1f261c4 made cmd_extscript WIN32 compatible --- diff --git a/src/cmd_neonserv_extscript.c b/src/cmd_neonserv_extscript.c index 21aad8b..1d97ac0 100644 --- a/src/cmd_neonserv_extscript.c +++ b/src/cmd_neonserv_extscript.c @@ -112,11 +112,13 @@ CMD_BIND(neonserv_cmd_extscript) { command[commandpos] = '\0'; //we should now have a valid command struct ClientSocket *textbot = getTextBot(); + #ifndef WIN32 pid_t pID = fork(); if (pID == 0) { //We're the child process :D pID = fork(); if(pID < 0) exit(EXIT_FAILURE); if(pID != 0) exit(EXIT_SUCCESS); + #endif FILE *fp; fp = popen(command, "r"); if (fp) { @@ -133,6 +135,7 @@ CMD_BIND(neonserv_cmd_extscript) { } else { reply(getTextBot(), user, "internal bot error - please contact an administrator!"); } + #ifndef WIN32 exit(EXIT_FAILURE); } else if (pID < 0) { reply(getTextBot(), user, "internal bot error - please contact an administrator!"); @@ -140,5 +143,6 @@ CMD_BIND(neonserv_cmd_extscript) { //parent bot - continue program wait(NULL); } + #endif } diff --git a/src/main.h b/src/main.h index 2b31e62..a2e9af1 100644 --- a/src/main.h +++ b/src/main.h @@ -37,11 +37,11 @@ #include #include #include +#include #endif #include #include #include -#include #include #if __GNUC__