From: wessels <> Date: Wed, 27 Mar 1996 11:42:08 +0000 (+0000) Subject: misc cleanup related to #include shuffle X-Git-Tag: SQUID_3_0_PRE1~6375 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0e08ce4bd4202a410239abeaf52b36ce534ecdfe;p=thirdparty%2Fsquid.git misc cleanup related to #include shuffle --- diff --git a/src/main.cc b/src/main.cc index 3d37532a54..b699de23aa 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,4 +1,4 @@ -/* $Id: main.cc,v 1.8 1996/03/27 02:13:04 wessels Exp $ */ +/* $Id: main.cc,v 1.9 1996/03/27 04:42:08 wessels Exp $ */ #include "squid.h" @@ -37,7 +37,6 @@ static int binaryPortNumOverride = 0; static int udpPortNumOverride = 0; void raise_debug_lvl(), reset_debug_lvl(); -void death(), deathb(), shut_down(), rotate_logs(); void sig_child(); int main(argc, argv) @@ -214,7 +213,7 @@ Usage: cached [-Rsehvz] [-f config-file] [-d debug-level] [-[apu] port]\n\ if (catch_signals) { signal(SIGSEGV, death); - signal(SIGBUS, deathb); + signal(SIGBUS, death); } signal(SIGPIPE, SIG_IGN); signal(SIGCHLD, sig_child); diff --git a/src/squid.h b/src/squid.h index 036c4e573a..ecb33dd4dd 100644 --- a/src/squid.h +++ b/src/squid.h @@ -1,5 +1,5 @@ -/* $Id: squid.h,v 1.1 1996/03/27 01:46:18 wessels Exp $ */ +/* $Id: squid.h,v 1.2 1996/03/27 04:42:09 wessels Exp $ */ #include "config.h" #include "autoconf.h" @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -20,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -66,12 +64,12 @@ typedef struct icp_common_s icp_common_t; typedef struct _cacheinfo cacheinfo; /* 32 bit integer compatability hack */ -#if SIZEOF_LONG == 4 -typedef long num32; -typedef unsigned long u_num32; -#elif SIZEOF_INT == 4 +#if SIZEOF_INT == 4 typedef int num32; typedef unsigned int u_num32; +#elif SIZEOF_LONG == 4 +typedef long num32; +typedef unsigned long u_num32; #else typedef long num32; /* assume that long's are 32bit */ typedef unsigned long u_num32; diff --git a/src/store.cc b/src/store.cc index 19dd19184c..e15136ffd6 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,5 +1,5 @@ -/* $Id: store.cc,v 1.10 1996/03/27 01:46:23 wessels Exp $ */ +/* $Id: store.cc,v 1.11 1996/03/27 04:42:09 wessels Exp $ */ /* * Here is a summary of the routines which change mem_status and swap_status: @@ -2344,7 +2344,7 @@ int urlcmp(url1, url2) char *url1, *url2; { if (!url1 || !url2) - death(); + fatal_dump("urlcmp: Got a NULL url pointer.\n"); return (strcmp(url1, url2)); } diff --git a/src/tools.cc b/src/tools.cc index ea6c150796..cc4b821633 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1,5 +1,5 @@ -/* $Id: tools.cc,v 1.7 1996/03/27 02:13:04 wessels Exp $ */ +/* $Id: tools.cc,v 1.8 1996/03/27 04:42:10 wessels Exp $ */ #include "squid.h" @@ -55,11 +55,18 @@ void print_warranty() puts(dead_msg()); } -void death() +void death(sig) + int sig; { - fprintf(stderr, "FATAL: Received Segment Violation...dying.\n"); + if (sig == SIGSEGV) + fprintf(stderr, "FATAL: Received Segment Violation...dying.\n"); + else if (sig == SIGBUS) + fprintf(stderr, "FATAL: Received bus error...dying.\n"); + else + fprintf(stderr, "FATAL: Received signal %d...dying.\n", sig); signal(SIGSEGV, SIG_DFL); signal(SIGBUS, SIG_DFL); + signal(sig, SIG_DFL); storeWriteCleanLog(); PrintRusage(NULL, stderr); print_warranty(); @@ -67,18 +74,6 @@ void death() } -void deathb() -{ - fprintf(stderr, "FATAL: Received bus error...dying.\n"); - signal(SIGSEGV, SIG_DFL); - signal(SIGBUS, SIG_DFL); - signal(SIGBUS, SIG_DFL); - storeWriteCleanLog(); - PrintRusage(NULL, stderr); - print_warranty(); - abort(); -} - void rotate_logs(sig) int sig; {