Branch: Tag:

2000-03-20

2000-03-20 21:00:57 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

make watchdog exit more quitly, helps profiling..

Rev: bin/test_pike.pike:1.38

1:   #!/usr/local/bin/pike    - /* $Id: test_pike.pike,v 1.37 2000/03/07 08:14:57 hubbe Exp $ */ + /* $Id: test_pike.pike,v 1.38 2000/03/20 20:57:34 hubbe Exp $ */      import Stdio;   
181: Inside #if defined(WATCHDOG)
   while(1)    {    sleep(10); -  if(exit_quietly) exit(0); +  if(exit_quietly) _exit(0);   #ifndef __NT__ -  if(!kill(pid, 0)) exit(0); +  if(!kill(pid, 0)) _exit(0);   #endif   // werror("[WATCHDOG] t=%d\n",time()-last_time);   
192: Inside #if defined(WATCHDOG)
   {    werror("\n[WATCHDOG] Pike testsuite timeout, sending SIGABRT.\n");    kill(pid, signum("SIGABRT")); -  for(int q=0;q<60;q++) if(!kill(pid,0)) exit(0); else sleep(1); +  for(int q=0;q<60;q++) if(!kill(pid,0)) _exit(0); else sleep(1);    werror("\n"    "[WATCHDOG] This is your friendly watchdog again...\n"    "[WATCHDOG] testsuite failed to die from SIGABRT, sending SIGKILL\n");    kill(pid, signum("SIGKILL")); -  for(int q=0;q<60;q++) if(!kill(pid,0)) exit(0); else sleep(1); +  for(int q=0;q<60;q++) if(!kill(pid,0)) _exit(0); else sleep(1);    werror("\n"    "[WATCHDOG] This is your friendly watchdog AGAIN...\n"    "[WATCHDOG] SIGKILL, SIGKILL, SIGKILL, DIE!\n");
205: Inside #if defined(WATCHDOG)
   kill(pid, signum("SIGKILL"));    kill(pid, signum("SIGKILL"));    kill(pid, signum("SIGKILL")); -  for(int q=0;q<60;q++) if(!kill(pid,0)) exit(0); else sleep(1); +  for(int q=0;q<60;q++) if(!kill(pid,0)) _exit(0); else sleep(1);    werror("\n"    "[WATCHDOG] Giving up, must be a device wait.. :(\n"); -  exit(0); +  _exit(0);    }    }   #else -  exit(1); +  _exit(1);   #endif    break;   
641: Inside #if defined(WATCHDOG_SIGNAL)
     #ifdef WATCHDOG_SIGNAL    if(use_watchdog) +  {    watchdog->kill(signum("SIGKILL")); -  +  watchdog->wait(); +  }   #endif    -  + #ifdef WATCHDOG_PIPE +  if(use_watchdog) +  { +  destruct(watchdog_pipe); + #if constant(signum) +  catch { watchdog->kill(signum("SIGKILL")); }; + #endif +  watchdog->wait(); +  } + #endif +     return errors;   }