projects
/
NeonServV5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
aab6722
)
made cmd_extscript WIN32 compatible
author
pk910
<philipp@zoelle1.de>
Sat, 5 Nov 2011 06:01:15 +0000
(07:01 +0100)
committer
pk910
<philipp@zoelle1.de>
Sat, 5 Nov 2011 06:03:12 +0000
(07:03 +0100)
src/cmd_neonserv_extscript.c
patch
|
blob
|
history
src/main.h
patch
|
blob
|
history
diff --git
a/src/cmd_neonserv_extscript.c
b/src/cmd_neonserv_extscript.c
index 21aad8b9f0abb844d2fb26c9e50126906eb3f2bb..1d97ac0fc576bb5bafa1adbfdd62c8802565713e 100644
(file)
--- 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();
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);
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) {
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!");
}
} 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!");
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);
}
//parent bot - continue program
wait(NULL);
}
+ #endif
}
}
diff --git
a/src/main.h
b/src/main.h
index 2b31e62edefaa2cacd26a89f57441337c6461736..a2e9af1352a535e547778cbe3dfae90ce14dbaa0 100644
(file)
--- a/
src/main.h
+++ b/
src/main.h
@@
-37,11
+37,11
@@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
+#include <sys/wait.h>
#endif
#include <unistd.h>
#include <stdarg.h>
#include <sys/time.h>
#endif
#include <unistd.h>
#include <stdarg.h>
#include <sys/time.h>
-#include <sys/wait.h>
#include <time.h>
#if __GNUC__
#include <time.h>
#if __GNUC__