Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29321
Modified Files: Tag: impd_0_37 s_inter.c Log Message: signal stuff. i would've liked to trap segfaults and redirect them to gdb --attach, but it doesn't seem feasible... i guess the right thing to do is to not write bugs in the first place =)
Index: s_inter.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_inter.c,v retrieving revision 1.1.1.3.2.9.2.6 retrieving revision 1.1.1.3.2.9.2.7 diff -C2 -d -r1.1.1.3.2.9.2.6 -r1.1.1.3.2.9.2.7 *** s_inter.c 8 Apr 2004 01:46:03 -0000 1.1.1.3.2.9.2.6 --- s_inter.c 10 May 2004 16:12:23 -0000 1.1.1.3.2.9.2.7 *************** *** 498,502 **** fprintf(stderr, "Pd: signal %d\n", n); /* isn't really useful, because it sees only ! the signal stack, not the app's stack #ifdef UNIX { --- 498,502 ---- fprintf(stderr, "Pd: signal %d\n", n); /* isn't really useful, because it sees only ! the signal stack, not the app's stack */ #ifdef UNIX { *************** *** 507,511 **** } #endif - */ sys_bail(1); } --- 507,510 ---- *************** *** 587,590 **** --- 586,614 ---- };
+ void sys_setsignals(void) { + #ifdef UNIX + signal(SIGHUP, sys_huphandler); + signal(SIGINT, sys_exithandler); + signal(SIGQUIT, sys_exithandler); + signal(SIGIOT, sys_exithandler); + signal(SIGFPE, SIG_IGN); + /* + signal(SIGILL, sys_apocalypse); + signal(SIGBUS, sys_apocalypse); + signal(SIGSEGV, sys_apocalypse); + */ + signal(SIGILL, sys_exithandler); + signal(SIGBUS, sys_exithandler); + signal(SIGSEGV, sys_exithandler); + + signal(SIGPIPE, sys_exithandler); + signal(SIGALRM, SIG_IGN); + signal(SIGTERM, SIG_IGN); + #if 0 /* GG says: don't use that */ + signal(SIGSTKFLT, sys_exithandler); + #endif + #endif + } + int sys_startgui(const char *guidir) { *************** *** 606,627 **** sys_nfdpoll = 0; inbinbuf = binbuf_new(); ! ! #ifdef UNIX ! signal(SIGHUP, sys_huphandler); ! signal(SIGINT, sys_exithandler); ! signal(SIGQUIT, sys_exithandler); ! signal(SIGILL, sys_exithandler); ! signal(SIGIOT, sys_exithandler); ! signal(SIGFPE, SIG_IGN); ! signal(SIGILL, sys_apocalypse); ! signal(SIGBUS, sys_apocalypse); ! signal(SIGSEGV, sys_apocalypse); ! signal(SIGPIPE, sys_exithandler); ! signal(SIGALRM, SIG_IGN); ! signal(SIGTERM, SIG_IGN); ! #if 0 /* GG says: don't use that */ ! signal(SIGSTKFLT, sys_exithandler); ! #endif ! #endif #ifdef MSW if (WSAStartup(version, &nobby)) sys_sockerror("WSAstartup"); --- 630,634 ---- sys_nfdpoll = 0; inbinbuf = binbuf_new(); ! /* sys_setsignals(); */ #ifdef MSW if (WSAStartup(version, &nobby)) sys_sockerror("WSAstartup");