Skip to content

Commit

Permalink
Trap recursive bad_signal calls; idea from Richard Hipp.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulusmack committed May 5, 1998
1 parent 671b8cc commit a730390
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pppd/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

#ifndef lint
static char rcsid[] = "$Id: main.c,v 1.48 1998/04/28 23:37:30 paulus Exp $";
static char rcsid[] = "$Id: main.c,v 1.49 1998/05/05 05:24:17 paulus Exp $";
#endif

#include <stdio.h>
Expand Down Expand Up @@ -1037,6 +1037,11 @@ static void
bad_signal(sig)
int sig;
{
static int crashed = 0;

if (crashed)
_exit(127);
crashed = 1;
syslog(LOG_ERR, "Fatal signal %d", sig);
if (conn_running)
kill_my_pg(SIGTERM);
Expand Down

0 comments on commit a730390

Please sign in to comment.