diff options
author | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-03-22 16:31:56 +0000 |
---|---|---|
committer | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-03-22 16:31:56 +0000 |
commit | b5735b90f5ec847a89acd80509e8ba2ce23a3905 (patch) | |
tree | c784ba41982fe5370eee9245d9fe65063b389328 /src/common/core.c | |
parent | e52e5e17df12881d87065106a96ed48a9d302555 (diff) | |
download | hercules-b5735b90f5ec847a89acd80509e8ba2ce23a3905.tar.gz hercules-b5735b90f5ec847a89acd80509e8ba2ce23a3905.tar.bz2 hercules-b5735b90f5ec847a89acd80509e8ba2ce23a3905.tar.xz hercules-b5735b90f5ec847a89acd80509e8ba2ce23a3905.zip |
Check changelog ^^
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1267 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/core.c')
-rw-r--r-- | src/common/core.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/common/core.c b/src/common/core.c index 02ba004ae..96d2c872b 100644 --- a/src/common/core.c +++ b/src/common/core.c @@ -76,7 +76,11 @@ sigfunc *compat_signal(int signo, sigfunc *func) * CORE : Signal Sub Function *-------------------------------------- */ - +// for handling certain signals ourselves, like SIGPIPE +static void sig_ignore(int sn) { + printf ("Broken pipe found... closing socket\n"); // set to eof in socket.c + return; // does nothing here +} static void sig_proc(int sn) { int i; @@ -137,8 +141,7 @@ void sig_dump(int sn) fprintf(fp, "Exception: %s \n", strsignal(sn)); fflush (fp); - - #ifdef CYGWIN + #ifdef CYGWIN cygwin_stackdump (); #else fprintf(fp, "Stack trace:\n"); @@ -153,7 +156,7 @@ void sig_dump(int sn) printf ("Done.\n"); fflush(stdout); - fclose(fp); + fclose(fp); } // Pass the signal to the system's default handler compat_signal(sn, SIG_DFL); @@ -289,7 +292,7 @@ int main(int argc,char **argv) Net_Init(); do_socket(); - compat_signal(SIGPIPE,SIG_IGN); + compat_signal(SIGPIPE, sig_ignore); compat_signal(SIGTERM,sig_proc); compat_signal(SIGINT,sig_proc); |