Shut down cleanly on receipt of SIGTERM

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@23144 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2006-07-07 04:14:14 +00:00
parent 940a0eabbe
commit 8cc7985bd4
2 changed files with 15 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2006-07-07 Richard Frith-Macdonald <rfm@gnu.org>
* Source/x11/XGServer.m:
Handle SIGTERM by calling ([NSApp terminate: NSApp]) to shut down
cleanly.
2006-07-04 Richard Frith-Macdonald <rfm@gnu.org>
* Source/art/ftfont.m:

View file

@ -39,6 +39,14 @@
#include <Foundation/NSUserDefaults.h>
#include <Foundation/NSDebug.h>
#include <signal.h>
/* Terminate cleanly if we get a signal to do so */
static void
terminate(int sig)
{
[NSApp terminate: NSApp];
}
#ifdef HAVE_WRASTER_H
#include "wraster.h"
#else
@ -347,6 +355,7 @@ _parse_display_name(NSString *name, int *dn, int *sn)
{
NSDebugLog(@"Initializing GNUstep x11 backend.\n");
[GSDisplayServer setDefaultServerClass: [XGServer class]];
signal(SIGTERM, terminate);
}
/**