diff options
author | Marc G. Fournier | 1996-09-19 20:16:55 +0000 |
---|---|---|
committer | Marc G. Fournier | 1996-09-19 20:16:55 +0000 |
commit | ee9b8016c70ac84cf56079a6879f9ebb5753e81f (patch) | |
tree | ba4d1fb9262d55d67c751bc95d4a0a898f693dcd /contrib/pginterface/halt.c | |
parent | 9fb31dcb5440d587bb45f6a5d63e1258c7db47bb (diff) |
Clean out the old...
Diffstat (limited to 'contrib/pginterface/halt.c')
-rw-r--r-- | contrib/pginterface/halt.c | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/contrib/pginterface/halt.c b/contrib/pginterface/halt.c deleted file mode 100644 index 58ca11a5878..00000000000 --- a/contrib/pginterface/halt.c +++ /dev/null @@ -1,58 +0,0 @@ -/* -** -** halt.c -** -** This is used to print out error messages and exit -*/ - -#include <varargs.h> -#include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <errno.h> - - -/*------------------------------------------------------------------------- -** -** halt - print error message, and call clean up routine or exit -** -**------------------------------------------------------------------------*/ - -/*VARARGS*/ -void halt(va_alist) -va_dcl -{ - va_list arg_ptr; - char *format, *pstr; - void (*sig_func)(); - - va_start(arg_ptr); - format = va_arg(arg_ptr,char *); - if (strncmp(format,"PERROR", 6) != 0) - vfprintf(stderr,format,arg_ptr); - else - { - for (pstr=format+6; *pstr == ' ' || *pstr == ':'; pstr++) - ; - vfprintf(stderr,pstr,arg_ptr); - perror(""); - } - va_end(arg_ptr); - fflush(stderr); - - /* call one clean up function if defined */ - if ( (sig_func = signal(SIGTERM, SIG_DFL)) != SIG_DFL && - sig_func != SIG_IGN) - (*sig_func)(0); - else if ( (sig_func = signal(SIGHUP, SIG_DFL)) != SIG_DFL && - sig_func != SIG_IGN) - (*sig_func)(0); - else if ( (sig_func = signal(SIGINT, SIG_DFL)) != SIG_DFL && - sig_func != SIG_IGN) - (*sig_func)(0); - else if ( (sig_func = signal(SIGQUIT, SIG_DFL)) != SIG_DFL && - sig_func != SIG_IGN) - (*sig_func)(0); - exit(1); -} |