-/* $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"
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)
if (catch_signals) {
signal(SIGSEGV, death);
- signal(SIGBUS, deathb);
+ signal(SIGBUS, death);
}
signal(SIGPIPE, SIG_IGN);
signal(SIGCHLD, sig_child);
-/* $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"
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
-#include <bstring.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <string.h>
#include <strings.h>
-#include <sys/errno.h>
#include <sys/param.h>
#include <sys/resource.h>
#include <sys/select.h>
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;
-/* $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:
char *url1, *url2;
{
if (!url1 || !url2)
- death();
+ fatal_dump("urlcmp: Got a NULL url pointer.\n");
return (strcmp(url1, url2));
}
-/* $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"
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();
}
-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;
{