summaryrefslogtreecommitdiff
path: root/src/common/core.c
diff options
context:
space:
mode:
authorMadCamel <madcamel@gmail.com>2009-07-24 06:14:45 -0400
committerMadCamel <madcamel@gmail.com>2009-07-24 06:18:28 -0400
commit2e10b429a9bad28a4c7999d3a0f5184e48ab1f93 (patch)
tree9f3f71bddf100ae115c9852e47bd939f1e5543dd /src/common/core.c
parenta626960e74117bad7b906fa51b3b311b1f4972a0 (diff)
downloadtmwa-2e10b429a9bad28a4c7999d3a0f5184e48ab1f93.tar.gz
tmwa-2e10b429a9bad28a4c7999d3a0f5184e48ab1f93.tar.bz2
tmwa-2e10b429a9bad28a4c7999d3a0f5184e48ab1f93.tar.xz
tmwa-2e10b429a9bad28a4c7999d3a0f5184e48ab1f93.zip
char-server now offloads file writes to a child process
Should see a massive speedup as it's now free to do other things. If processes start piling up, decrease the save frequency.
Diffstat (limited to 'src/common/core.c')
-rw-r--r--src/common/core.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/common/core.c b/src/common/core.c
index 2546f4e..7267d8f 100644
--- a/src/common/core.c
+++ b/src/common/core.c
@@ -7,6 +7,7 @@
#include <unistd.h>
#endif
#include <signal.h>
+#include <wait.h>
#include "core.h"
#include "socket.h"
@@ -48,6 +49,9 @@ static void sig_proc(int sn)
}
exit(0);
break;
+ case SIGCHLD:
+ wait(&i);
+ break;
}
}
@@ -135,7 +139,8 @@ int main(int argc,char **argv)
compat_signal(SIGPIPE,SIG_IGN);
compat_signal(SIGTERM,sig_proc);
compat_signal(SIGINT,sig_proc);
-
+ compat_signal(SIGCHLD,sig_proc);
+
// Signal to create coredumps by system when necessary (crash)
compat_signal(SIGSEGV, SIG_DFL);
#ifndef LCCWIN32