made cmd_extscript WIN32 compatible
[NeonServV5.git] / src / cmd_neonserv_extscript.c
index 21aad8b9f0abb844d2fb26c9e50126906eb3f2bb..1d97ac0fc576bb5bafa1adbfdd62c8802565713e 100644 (file)
@@ -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
 }