diff options
author | Bruce Momjian <bruce@momjian.us> | 2013-06-19 12:31:23 -0400 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2013-06-19 12:31:26 -0400 |
commit | f979599b2068f036405f1b51a9c4260619b06941 (patch) | |
tree | e01b30eb5d5f1be8849be97ff08b8205b827bf03 /src/tools/entab/halt.c | |
parent | 8791627b8f9a9ce44603beec447bc6f18bfd9a36 (diff) | |
download | postgresql-f979599b2068f036405f1b51a9c4260619b06941.tar.gz postgresql-f979599b2068f036405f1b51a9c4260619b06941.zip |
Modernize entab source code
Remove halt.c, improve comments, rename manual page file.
Diffstat (limited to 'src/tools/entab/halt.c')
-rw-r--r-- | src/tools/entab/halt.c | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/src/tools/entab/halt.c b/src/tools/entab/halt.c deleted file mode 100644 index e7d2e4496be..00000000000 --- a/src/tools/entab/halt.c +++ /dev/null @@ -1,59 +0,0 @@ -/* -** -** halt.c -** -** src/tools/entab/halt.c -** -** This is used to print out error messages and exit -*/ - -#include <stdarg.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(const char *format,...) -{ - va_list arg_ptr; - const char *pstr; - void (*sig_func) (); - - va_start(arg_ptr, format); - 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); -} |