Only ignore SIGHUP if running as daemon

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/ec/trunk@36989 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2013-08-19 09:05:07 +00:00
parent dc4f189470
commit 02ab3e067b

View file

@ -144,7 +144,7 @@ qhandler(int sig)
{
signal(sig, ihandler);
/* We store the signal value in a global variable and return to normal
* processing ... that way later code can check on the sttate of the
* processing ... that way later code can check on the state of the
* variable and take action outside the handler.
* We can't act immediately here inside the handler as the signal may
* have interrupted some vital library (eg malloc()) and left it in a
@ -3385,7 +3385,6 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval);
case SIGPIPE:
case SIGTTOU:
case SIGTTIN:
case SIGHUP:
case SIGCHLD:
/* SIGWINCH is generated when the terminal size
@ -3398,6 +3397,17 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval);
signal(i, SIG_IGN);
break;
case SIGHUP:
if ([cmdDefs boolForKey: @"Daemon"] == YES)
{
signal(i, SIG_IGN);
}
else
{
signal(i, qhandler);
}
break;
case SIGINT:
case SIGTERM:
signal(i, qhandler);