DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T s

⟦fb183c076⟧ TextFile

    Length: 2409 (0x969)
    Types: TextFile
    Names: »siginit.c«

Derivation

└─⟦3d0c2be1b⟧ Bits:30001254 ISODE-5.0 Tape
    └─⟦eba4602b1⟧ »./isode-5.0.tar.Z« 
        └─⟦d3ac74d73⟧ 
            └─⟦this⟧ »isode-5.0/dsap/common/siginit.c« 

TextFile

/* signals.c - Catch some disastorous signals */

#ifndef lint
static char *rcsid = "$Header: /f/osi/dsap/common/RCS/siginit.c,v 6.0 89/03/18 23:27:47 mrose Rel $";
#endif

/*
 * $Header: /f/osi/dsap/common/RCS/siginit.c,v 6.0 89/03/18 23:27:47 mrose Rel $
 *
 *
 * $Log:	siginit.c,v $
 * Revision 6.0  89/03/18  23:27:47  mrose
 * Release 5.0
 * 
 */

/*
 *                                NOTICE
 *
 *    Acquisition, use, and distribution of this module and related
 *    materials are subject to the restrictions of a license agreement.
 *    Consult the Preface in the User's Manual for the full terms of
 *    this agreement.
 *
 */

#include "quipu/util.h"
#include "tsap.h"
#include <signal.h>

extern LLog * log_dsap;

SFD	coresig ();
SFD	quitsig ();

dsap_siginit ()
{
	(void) signal (SIGHUP, quitsig);
	(void) signal (SIGINT, quitsig);
	(void) signal (SIGPIPE, quitsig);
	(void) signal (SIGTERM, quitsig);

	(void) signal (SIGQUIT, coresig);
	(void) signal (SIGILL, coresig);
	(void) signal (SIGTRAP, coresig);
	(void) signal (SIGIOT, coresig);
/*      (void) signal (SIGEMT, coresig);  isode uses this! */
	(void) signal (SIGFPE, coresig);
	(void) signal (SIGBUS, coresig);
	(void) signal (SIGSEGV, coresig);
	(void) signal (SIGSYS, coresig);
}

/* ARGSUSED */
SFD coresig (sig, code, context)
int     sig, code;
struct sigcontext *context;
{
#ifndef OSX
	extern char *sys_siglist[];
#endif

	(void) signal (sig, SIG_DFL);    /* to stop recursion */
	(void) signal (SIGILL, SIG_DFL); /* for abort */
#ifdef OSX
	LLOG (log_dsap,LLOG_FATAL,("*** Process dying on signal %d ***",sig));
	(void) fprintf (stderr,"signal %d - core dumped\n",sig);
#else
	LLOG (log_dsap,LLOG_FATAL,("*** Process dying on signal %d (%s) ***", sig, sys_siglist[sig]));
	(void) fprintf (stderr,"%s - core dumped\n",sys_siglist[sig]);
#endif
	stop_listeners();
	abort ();
}

/* ARGSUSED */
SFD quitsig (sig, code, context)
int     sig, code;
struct sigcontext *context;
{
#ifndef OSX
	extern char *sys_siglist[];
#endif

#ifdef OSX
	LLOG (log_dsap,LLOG_FATAL,("*** Process stopped by signal %d ***",sig));
#else
	LLOG (log_dsap,LLOG_FATAL,("*** Process stopped by signal %d (%s) ***", sig, sys_siglist[sig]));
#endif
	(void) fflush (stdout);
	(void) fprintf (stderr,"Quitting...\n");
	stop_listeners();
	exit (0);
}


stop_listeners ()
{
struct TSAPdisconnect td;

	/* close all listeners */
	(void) TNetClose (NULLTA,&td);
}