ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/utils.C
(Generate patch)

Comparing deliantra/server/common/utils.C (file contents):
Revision 1.79 by root, Sat Aug 30 05:19:03 2008 UTC vs.
Revision 1.82 by root, Thu Sep 11 12:43:17 2008 UTC

449void 449void
450fork_abort (const char *msg) 450fork_abort (const char *msg)
451{ 451{
452 if (!fork ()) 452 if (!fork ())
453 { 453 {
454 signal (SIGINT , SIG_IGN);
455 signal (SIGTERM, SIG_IGN);
454 signal (SIGABRT, SIG_DFL); 456 signal (SIGABRT, SIG_IGN);
457
458 signal (SIGSEGV, SIG_DFL);
459 signal (SIGBUS , SIG_DFL);
460 signal (SIGILL , SIG_DFL);
461 signal (SIGTRAP, SIG_DFL);
455 462
456 // try to put corefiles into a subdirectory, if existing, to allow 463 // try to put corefiles into a subdirectory, if existing, to allow
457 // an administrator to reduce the I/O load. 464 // an administrator to reduce the I/O load.
458 chdir ("cores"); 465 chdir ("cores");
459 466
467 474
468 for (int i = 0; i < lim.rlim_cur; ++i) 475 for (int i = 0; i < lim.rlim_cur; ++i)
469 close (i); 476 close (i);
470 } 477 }
471 478
479 {
480 sigset_t empty;
481 sigemptyset (&empty);
482 sigprocmask (SIG_SETMASK, &empty, 0);
483 }
484
485 // try to coredump with SIGTRAP
486 kill (getpid (), SIGTRAP);
472 abort (); 487 abort ();
473 } 488 }
474 489
475 LOG (llevError, "fork abort: %s\n", msg); 490 LOG (llevError, "fork abort: %s\n", msg);
476} 491}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines