diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-08-31 13:22:39 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-08-31 13:22:39 -0600 |
commit | 67a8847e17aa72981bbf3b4c15167cc0ef499da1 (patch) | |
tree | 30b07708a5893712ea1a0bb4835881caa3dd97f7 /src/common/core.c | |
parent | 0e36f6e8d82e7cb0f01683454790a7123ea03197 (diff) | |
parent | dbd9d0321c66deeecf01445f8298aa5076391fbd (diff) | |
download | tmwa-67a8847e17aa72981bbf3b4c15167cc0ef499da1.tar.gz tmwa-67a8847e17aa72981bbf3b4c15167cc0ef499da1.tar.bz2 tmwa-67a8847e17aa72981bbf3b4c15167cc0ef499da1.tar.xz tmwa-67a8847e17aa72981bbf3b4c15167cc0ef499da1.zip |
Merge commit 'taw/master'
Diffstat (limited to 'src/common/core.c')
-rw-r--r-- | src/common/core.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/common/core.c b/src/common/core.c index 2546f4e..94a754b 100644 --- a/src/common/core.c +++ b/src/common/core.c @@ -7,11 +7,13 @@ #include <unistd.h> #endif #include <signal.h> +#include <wait.h> #include "core.h" #include "socket.h" #include "timer.h" #include "version.h" +#include "mt_rand.h" #ifdef MEMWATCH #include "memwatch.h" @@ -48,6 +50,9 @@ static void sig_proc(int sn) } exit(0); break; + case SIGCHLD: + wait(&i); + break; } } @@ -129,13 +134,16 @@ int main(int argc,char **argv) { int next; + mt_seed(time(NULL) ^ getpid() ^ getppid()); + Net_Init(); do_socket(); 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 |