]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
revert unwanted changes slipped into rev10756.
authorAmos Jeffries <amosjeffries@squid-cache.org>
Thu, 19 Aug 2010 03:14:16 +0000 (21:14 -0600)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Thu, 19 Aug 2010 03:14:16 +0000 (21:14 -0600)
13 files changed:
configure.in
lib/Makefile.am
tools/Makefile.am
tools/purge/Makefile [new file with mode: 0644]
tools/purge/convert.cc
tools/purge/copyout.cc
tools/purge/hexd.c [new file with mode: 0644]
tools/purge/hexd.cc [deleted file]
tools/purge/purge.cc
tools/purge/signal.cc
tools/purge/signal.hh
tools/purge/socket.cc
tools/purge/squid-tlv.cc

index d05efe5f1b1f360547476b153c28fdcf49459f83..591c7f7a73814009f9b9a41a5c8d0ab90a0116b1 100644 (file)
@@ -2125,7 +2125,6 @@ AC_CHECK_HEADERS( \
   regex.h \
   sched.h \
   security/pam_appl.h \
-  siginfo.h \
   signal.h \
   sstream \
   stdarg.h \
@@ -2146,7 +2145,7 @@ AC_CHECK_HEADERS( \
   sys/md5.h \
   sys/msg.h \
   sys/resource.h \
-  sys/select.h \
+  sys/select.h\
   sys/socket.h \
   sys/stat.h \
   sys/statvfs.h \
@@ -2918,7 +2917,6 @@ AC_REPLACE_FUNCS(\
        initgroups \
        getaddrinfo \
        getnameinfo \
-       psignal \
        strerror \
        strsep \
        strtoll \
@@ -3240,7 +3238,6 @@ AC_CONFIG_FILES([\
        helpers/url_rewrite/Makefile \
        helpers/url_rewrite/fake/Makefile \
        tools/Makefile
-       tools/purge/Makefile
 ])
 
 AC_CONFIG_SUBDIRS(lib/libTrie)
index a1fcf15c3726b24a2b72ea3be8d79ee5fda870f5..f474316568fd6c068c1975793f509cba37dac2c2 100644 (file)
@@ -46,7 +46,6 @@ EXTRA_libmiscutil_a_SOURCES = \
        md5.c \
        Profiler.c \
        win32lib.c
-
 libmiscutil_a_SOURCES = \
        MemPool.cc \
        MemPoolChunked.cc \
index 8d0d18234756bd0f349cf8fe09c265f584169160..5efe2628e1b5c3b53ed4fe6e214e873627dfbef5 100644 (file)
@@ -11,7 +11,7 @@ AUTOMAKE_OPTIONS = subdir-objects
 ## we need our local files too (but avoid -I. at all costs)
 INCLUDES += -I$(srcdir)
 
-SUBDIRS = purge
+SUBDIRS = 
 EXTRA_DIST = 
 man_MANS = 
 DISTCLEANFILES = 
diff --git a/tools/purge/Makefile b/tools/purge/Makefile
new file mode 100644 (file)
index 0000000..a9cbf8e
--- /dev/null
@@ -0,0 +1,181 @@
+#
+# Makefile
+#
+# The Makefile is divided into three sections, the "generic section", the
+# "host section" and the "rules section". The generics section defines
+# defaults which you should not change. Changes should solely be made to
+# the rules section.
+#
+# You will need to select several parameters befitting your compiler/system:
+#
+# -DHAS_BOOL   - set, if your C++ compiler knows about the 'bool' type.
+# -DHAS_PSIGNAL - set, if your libc supports psignal(int,const char*).
+# -fno-exceptions - may not be recognized by all variants of g++
+# -ffor-scope  - the new ANSI C++ scoping of for() variables is used...
+#
+# === [1] ==================================================== generics section
+#
+CXX    = g++ -ffor-scope -DHAS_BOOL -DHAS_PSIGNAL
+CC     = gcc
+LD     = $(CC)         # yes, I do mean gcc and not g++
+CXXFLAGS = # -pg -g # -fprofile-arcs -ftest-coverage
+SYSTEM  = $(shell uname -s | tr '[a-z]' '[A-Z]' | tr -d '_ -/')
+CPU    = $(shell uname -p)
+VERSION = $(shell uname -r)
+HOST   = $(shell uname -n)
+MAJOR   = $(firstword $(subst ., ,$(VERSION)))
+MINOR   = $(strip $(word 2,$(subst ., ,$(VERSION))))
+LOADLIBES =
+SOCKLEN        = int # default except for glibc2?
+
+# optimization levels - Do *not* use levels above -O1 with g++,
+# if -fprofile-arcs or -ftest-coverage is selected! Set to different
+# values in the host specific section below.
+#
+# - OPT_NORM for normal level optimization, O2 is a good choice.
+#
+OPT_NORM = -O2
+
+# electric fence library, for test purposes only (helps w/ memory leaks)
+# (developers only)
+EFENCE = -L/usr/local/lib -lefence
+
+#
+# === [2] ======================================================= hosts section
+#
+
+ifeq (SUNOS,${SYSTEM})
+ifeq (5,${MAJOR})
+# use these for the SUN CC compiler (for STL, see below or above)
+# You must define this for Solaris 2.x: CXXFLAGS = -DSOLARIS 
+CC     = cc
+#CXX   = CC -DHAS_BOOL -DHAS_PSIGNAL -DHAS_MUTABLE
+#CXXFLAGS = -DSOLARIS  '-library=%none,Cstd,Crun' 
+#CXXFLAGS += -dalign -ftrap=%none -fsimple -xlibmil
+#OPT_NORM = -xtarget=ultra2 -xO4
+#EXTRALIB += -lnsl -lsocket
+#LD    = CC
+#
+## g++ settings for Solaris on Ultra Sparcs (comment out all of above):
+CXXFLAGS += -DSOLARIS # -ggdb
+OPT_NORM = -O2 # -mcpu=supersparc
+LD     = $(CC)
+##
+#EXTRALIB += -lnsl -lsocket -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
+else
+# old SunOS 4.1.x, not supported!
+CXXFLAGS += -DSUN
+endif
+endif
+
+ifeq (IRIX64,${SYSTEM})
+# The regular 64bit Irix stuff is just too slow, use n32!
+SYSTEM        := IRIX
+endif
+
+ifeq (FREEBSD,${SYSTEM})
+SOCKLEN        = socklen_t
+endif
+
+ifeq (IRIX,${SYSTEM})
+CXX     = CC -n32 -mips3 -r4000 -DEFAULT:abi=n32:isa=mips3:proc=r4k
+CXX    += -LANG:ansi-for-init-scope=on -LANG:bool=on
+CXX    += -LANG:exceptions=off -LANG:explicit=off -LANG:wchar_t=off
+CXX    += -LANG:mutable=on -LANG:namespaces=on -LANG:std
+CC     = cc -n32 -mips3 -r4000
+CXXFLAGS = -woff 1174 -LANG:exceptions=off -DHAS_BOOL -DHAS_PSIGNAL
+LD     = $(CXX)
+OPT_NORM = -O3 -IPA -LNO:opt=1
+# for g++
+#CXXFLAGS += -mips3 -mcpu=r4000 
+endif
+
+ifeq (AIX,${SYSTEM})
+ifeq (,${MINOR})
+MINOR  := ${MAJOR}
+MAJOR  = 4
+endif
+CXX    = xlC -UHAS_BOOL -UHAS_PSIGNAL
+CC     = xlc
+CXXFLAGS = -qtune=pwr # -qdbxextra -g
+#CXX   = g++ -ffor-scope -DHAS_BOOL -UHAS_PSIGNAL
+SOCKLEN        = size_t
+LD     = $(CXX)
+endif
+
+ifeq (LINUX,${SYSTEM})
+# determine highest version of all installed libc's.
+LIBCVER = $(shell /bin/ls /lib/libc.so.? | \
+       awk -F'.' '{ if (m<$$3) m=$$3;} END { print m} ')
+ifeq (6,${LIBCVER})
+SOCKLEN        = socklen_t
+endif
+CXXFLAGS += -DHAS_PSIGNAL -DLIBCVERSION=$(LIBCVER) -pipe # -Wall -pedantic
+OPT_NORM = -O2
+# if your g++ balks (e.g. SuSE still uses 2.7.2.3)
+#CXXFLAGS += -DHAS_PSIGNAL -DLIBCVERSION=$(LIBCVER) -m486
+LD     = $(CC)
+EXTRALIB = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
+endif
+
+#
+# === [3] ======================================================= rules section
+# There is no need to change things below this line.
+CXXFLAGS += -D${SYSTEM} -DMAJOR=${MAJOR} -DMINOR=${MINOR} -DSOCKLEN=${SOCKLEN}
+CFLAGS = $(CXXFLAGS)
+LDFLAGS += $(OPT_NORM)
+
+%.o:%.cc
+       $(CXX) $(CXXFLAGS) $(OPT_NORM) -c $< -o $@
+
+OBJS   = convert.o socket.o signal.o squid-tlv.o copyout.o conffile.o
+SRCS   = $(OBJS:.o=.cc)
+HDRS   = $(OBJS:.o=.hh)
+FILES  = $(SRCS) $(HDRS) Makefile purge.cc hexd.c
+DIST   = $(addprefix purge/,$(FILES) README)
+
+all: purge
+
+purge: $(OBJS) purge.o 
+       $(LD) $(OPT_NORM) $(LDFLAGS) $^ -o $@ $(LOADLIBES) $(EXTRALIB)
+hexd: hexd.o
+       $(CC) $(OPT_NORM) $(LDFLAGS) $^ -o $@ $(LOADLIBES)
+#
+# object file rules, generated with "g++ -MM -E *.cc"
+#
+purge.o: purge.cc $(HDRS)
+       $(CXX) $(CXXFLAGS) $(OPT_NORM) -c $< -o $@
+convert.o: convert.cc convert.hh
+conffile.o: conffile.cc conffile.hh
+signal.o: signal.cc signal.hh
+socket.o: socket.cc socket.hh convert.hh
+squid-tlv.o: squid-tlv.cc squid-tlv.hh
+copyout.o: copyout.cc copyout.hh
+hexd.o: hexd.c
+
+clean:
+       $(RM) *.o
+       if [ "${SYSTEM}" = "IRIX"  ]; then rm -rf ii_files; fi
+       if [ "${SYSTEM}" = "SUNOS" ]; then rm -rf Templates.DB; fi
+       if [ "${SYSTEM}" = "SUNOS" ]; then rm -rf SunWS_cache; fi
+
+distclean: clean
+       $(RM) purge hexd
+
+realclean: distclean
+clobber: distclean
+
+co-all:        $(FILES)
+       echo all checked out
+co-all-lock:
+       co -l $(FILES)
+ci-all:
+       for i in $(FILES); do \
+               test -w $$i && ci $$i; \
+               rm -f $$i; \
+       done
+
+dist: distclean co-all
+       ( cd .. ; gtar cvzf purge-`date +"%Y%m%d"`-src.tar.gz $(DIST) )
+tar: distclean ci-all
+       ( cd .. ; gtar cvzf purge-`date +"%Y%m%d"`-all.tar.gz purge )
index 64238121ce00049fed5a9701ff318dc51e74c8e2..189d896b917a120364dfd922533cf98c01f59c64 100644 (file)
@@ -57,6 +57,9 @@
 #define SA struct sockaddr
 #endif
 
+static const char* RCS_ID =
+    "$Id$";
+
 const char*
 my_inet_ntoa( const struct in_addr& a, HostAddress output )
 // purpose: thread-safely convert IPv4 address -> ASCII representation
@@ -104,7 +107,7 @@ my_sock_fd2a( int fd, SockAddress buffer, bool peer )
 //          Refer to errno in case of error (usually unconnected fd...)
 {
     struct sockaddr_in socket;
-    socklen_t len = sizeof(socket);
+    SOCKLEN len = sizeof(socket);
 
     if ( (peer ? getpeername( fd, (SA*) &socket, &len ) :
             getsockname( fd, (SA*) &socket, &len )) == -1 )
index 53419c80fca6d96f9a0e16c94e9a0e180741bde0..525094e7466cd6a920b6916a894612bcd30f73a0 100644 (file)
 #pragma implementation
 #endif
 
-#include "config.h"
-#include "copyout.hh"
-
-//#include <assert.h>
-//#include <sys/types.h>
+#include <assert.h>
+#include <sys/types.h>
 #include <sys/stat.h>
 #include <stdio.h>
 #include <string.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <unistd.h>
-#include <sys/mman.h>
 
+#include <sys/mman.h>
 #ifndef MAP_FILE
 #define MAP_FILE 0
 #endif // MAP_FILE
 
+#include "copyout.hh"
+
+static const char* RCS_ID =
+    "$Id$";
+
 int
 assert_copydir( const char* copydir )
 // purpose: check, if copydir is a directory and that we can write into it.
diff --git a/tools/purge/hexd.c b/tools/purge/hexd.c
new file mode 100644 (file)
index 0000000..af7f8ef
--- /dev/null
@@ -0,0 +1,94 @@
+#include <ctype.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+
+unsigned char
+xlate( unsigned char ch )
+{
+    return (isprint(ch & 0x7f) ? ch : '.');
+}
+
+typedef struct {
+    int fd, rsize, cursor;
+    size_t bufsize;
+    unsigned char* buffer;
+} InputByByte;
+
+int
+in_open( InputByByte* this, const char* fn, size_t size )
+{
+    if ( (this->fd = open( fn, O_RDONLY )) == -1 ) return -1;
+    if ( (this->buffer=(unsigned char*) malloc(size)) == 0 ) {
+        close(this->fd);
+        return -1;
+    }
+    this->bufsize = size;
+    this->rsize = this->cursor = 0;
+    return 0;
+}
+
+int
+in_get( InputByByte* this )
+/*
+ * purpose: read next character
+ * returns: 0..255 as valid character, -1 for error, -2 for EOF
+ */
+{
+    if ( this->cursor >= this->rsize ) {
+        do {
+            this->rsize = read( this->fd, this->buffer, this->bufsize );
+        } while ( this->rsize == -1 && errno == EINTR );
+        if ( this->rsize > 0 ) this->cursor = 0;
+        else return ((-2) - this->rsize);
+    }
+
+    return this->buffer[this->cursor++];
+}
+
+int
+in_close( InputByByte* this )
+{
+    free((void*) this->buffer);
+    return close(this->fd);
+}
+
+int
+main( int argc, char* argv[] )
+{
+    int ch, i;
+    unsigned line = 0;
+    InputByByte in;
+    char b2[20];
+
+    if ( argc != 2 ) {
+        fprintf( stderr, "Usage: %s filename\n", argv[0] );
+        return 1;
+    }
+
+    if ( in_open(&in,argv[1],32768) == -1 ) {
+        perror( "open" );
+        return 1;
+    }
+
+    for ( ch = in_get(&in); ch >= 0; ) {
+        printf( "%08X: ", line );
+        memset( b2, 0, sizeof(b2) );
+        for ( i=0; i < 16 && ch >= 0; i++ ) {
+            printf( "%02X%c", ch, ((i==7) ? '-' : ' ' ) );
+            b2[i] = xlate(ch);
+            ch = in_get(&in);
+        }
+        line += i;
+        for ( ; i<16; i++ ) fputs("   ",stdout);
+        printf( " %s\n", b2 );
+    }
+
+    return in_close(&in);
+}
+
+
diff --git a/tools/purge/hexd.cc b/tools/purge/hexd.cc
deleted file mode 100644 (file)
index 1756067..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-#include "config.h"
-
-#include <stdio.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-
-class InputByByte
-{
-public:
-    int open(const char* fn, const size_t size);
-    int get();
-    int close();
-
-private:
-    int fd, rsize, cursor;
-    size_t bufsize;
-    unsigned char* buffer;
-};
-
-int
-InputByByte::open(const char* fn, const size_t size )
-{
-    if ( (fd = open( fn, O_RDONLY )) == -1 ) return -1;
-    if ( (buffer=(unsigned char*) malloc(size)) == 0 ) {
-        ::close(fd);
-        return -1;
-    }
-    bufsize = size;
-    rsize = cursor = 0;
-    return 0;
-}
-
-int
-InputByByte::get()
-/*
- * purpose: read next character
- * returns: 0..255 as valid character, -1 for error, -2 for EOF
- */
-{
-    if ( cursor >= rsize ) {
-        do {
-            rsize = read(fd, buffer, bufsize );
-        } while ( rsize == -1 && errno == EINTR );
-        if ( rsize > 0 ) cursor = 0;
-        else return ((-2) - rsize);
-    }
-
-    return buffer[cursor++];
-}
-
-int
-InputByByte::close()
-{
-    free((void*) buffer);
-    return close(fd);
-}
-
-int
-main( int argc, char* argv[] )
-{
-    int ch, i;
-    unsigned line = 0;
-    InputByByte in;
-    char b2[20];
-
-    if ( argc != 2 ) {
-        fprintf( stderr, "Usage: %s filename\n", argv[0] );
-        return 1;
-    }
-
-    if ( in.open(argv[1],32768) == -1 ) {
-        perror( "open" );
-        return 1;
-    }
-
-    for ( ch = in.get(); ch >= 0; ) {
-        printf( "%08X: ", line );
-        memset( b2, 0, sizeof(b2) );
-        for ( i=0; i < 16 && ch >= 0; i++ ) {
-            printf( "%02X%c", ch, ((i==7) ? '-' : ' ' ) );
-            b2[i] = (isprint(ch & 0x7f) ? ch : '.');
-            ch = in.get();
-        }
-        line += i;
-        for ( ; i<16; i++ ) fputs("   ",stdout);
-        printf( " %s\n", b2 );
-    }
-
-    return in.close();
-}
index 0ba6fcdd9e9ae490c3e897fa1de818b01c14e807..4031e933c42bdf3301774b16eb72515e4ce628ef 100644 (file)
 //
 #if defined(__GNUC__) || defined(__GNUG__)
 #pragma implementation
+#else
+#ifndef HAS_BOOL
+#define HAS_BOOL
+typedef int bool;
+#define false 0
+#define true  1
+#endif
 #endif
 
-#include "config.h"
-// for xstrdup
-#include "util.h"
-
-//#include <assert.h>
+#include <assert.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <dirent.h>
-//#include <ctype.h>
+#include <ctype.h>
 #include <string.h>
-//#include <sys/types.h>
+#include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
 #include <fcntl.h>
 #include <signal.h>
 #include <errno.h>
 
-#if HAVE_SIGINFO_H
+#if defined(HAS_PSIGNAL) && !defined(LINUX) && !defined(FREEBSD)
 #include <siginfo.h>
-#endif
+#endif // HAS_PSIGNAL
 
 #include <netinet/in.h>
 #include <netinet/tcp.h>  // TCP_NODELAY
@@ -154,7 +157,8 @@ static bool verbose  = false;
 static bool envelope = false;
 static bool no_fork  = false;
 static const char* programname = 0;
-static const char* RCS_ID = "$Id$";
+static const char* RCS_ID =
+    "$Id$";
 
 // ----------------------------------------------------------------------
 
@@ -169,7 +173,7 @@ struct REList {
 };
 
 REList::REList( const char* what, bool doCase )
-        :next(0),data(xstrdup(what))
+        :next(0),data(strdup(what))
 {
     int result = regcomp( &rexp, what,
                           REG_EXTENDED | REG_NOSUB | (doCase ? 0 : REG_ICASE) );
@@ -631,13 +635,13 @@ parseCommandline( int argc, char* argv[], REList*& head,
         case 'C':
             if ( optarg && *optarg ) {
                 if ( copydir ) free( (void*) copydir );
-                assert( (copydir = xstrdup(optarg)) );
+                assert( (copydir = strdup(optarg)) );
             }
             break;
         case 'c':
             if ( optarg && *optarg ) {
                 if ( *conffile ) free((void*) conffile );
-                assert( (conffile = xstrdup(optarg)) );
+                assert( (conffile = strdup(optarg)) );
             }
             break;
 
@@ -842,7 +846,7 @@ main( int argc, char* argv[] )
 {
     // setup variables
     REList* list = 0;
-    char* conffile = xstrdup( DEFAULT_SQUID_CONF );
+    char* conffile = strdup( DEFAULT_SQUID_CONF );
     serverPort = htons(DEFAULTPORT);
     if ( convertHostname(DEFAULTHOST,serverHost) == -1 ) {
         fprintf( stderr, "unable to resolve host %s!\n", DEFAULTHOST );
@@ -903,7 +907,7 @@ main( int argc, char* argv[] )
                 ::iamalive = false;
             }
 
-            for ( size_t i=0; i < cdv.size(); ++i ) {
+            for ( int i=0; i < cdv.size(); ++i ) {
                 if ( getpid() == getpgrp() ) {
                     // only parent == group leader may fork off new processes
                     if ( (child[i]=fork()) < 0 ) {
@@ -929,7 +933,7 @@ main( int argc, char* argv[] )
             // collect the garbase
             pid_t temp;
             int status;
-            for ( size_t i=0; i < cdv.size(); ++i ) {
+            for ( int i=0; i < cdv.size(); ++i ) {
                 while ( (temp=waitpid( (pid_t)-1, &status, 0 )) == -1 )
                     if ( errno == EINTR ) continue;
                 if ( ::debug ) printf( "collected child %d\n", (int) temp );
index 5eb91e3df1eb807cc3c629d4f12d0211f80805b6..3f302d2657ce3dfd157cf4a59799898e8b58e8fb 100644 (file)
 #pragma implementation
 #endif
 
-#include "config.h"
-#include "signal.hh"
-
-//#include <sys/types.h>
+#include <sys/types.h>
 #include <errno.h>
 #include <string.h>
 #include <memory.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <sys/wait.h>
-//#include <signal.h>
+#include <signal.h>
+
+#include "signal.hh"
+
+static const char* RCS_ID =
+    "$Id$";
+
+#ifndef HAS_PSIGNAL
+#ifdef AIX
+extern const char* const sys_siglist[];
+#define _sys_nsig 64
+#define _sys_siglist sys_siglist
+#endif // AIX
+
+void
+psignal( int sig, const char* msg )
+// purpose: print message, colon, space, signal name and LF.
+// paramtr: sig (IN): signal number
+//          msg (IN): message to prepend
+{
+    if ( msg && *msg ) fprintf( stderr, "%s: ", msg );
+    if ( sig > 0 && sig < _sys_nsig )
+        fprintf( stderr, "%s\n", _sys_siglist[sig] );
+    else
+        fputs( "(unknown)\n", stderr );
+}
+#endif // !HAS_PSIGNAL
 
 SigFunc*
 Signal( int signo, SigFunc* newhandler, bool doInterrupt )
@@ -115,10 +138,10 @@ sigChild( int signo )
     int saveerr = errno;
     while ( (pid = waitpid( -1, &status, WNOHANG )) > 0 ) {
         if ( WIFEXITED(status) ) {
-            snprintf( line, 128, "child (pid=%ld) reaped, status %d\n%c",
+            sprintf( line, "child (pid=%ld) reaped, status %d\n%c",
                      (long) pid, WEXITSTATUS(status), 0 );
         } else if ( WIFSIGNALED(status) ) {
-            snprintf( line, 128, "child (pid=%ld) died on signal %d%s\n%c",
+            sprintf( line, "child (pid=%ld) died on signal %d%s\n%c",
                      (long) pid, WTERMSIG(status),
 #ifdef WCOREDUMP
                      WCOREDUMP(status) ? " (core generated)" : "",
@@ -127,7 +150,7 @@ sigChild( int signo )
 #endif
                      0 );
         } else {
-            snprintf( line, 128, "detected dead child (pid=%ld), status %d\n%c",
+            sprintf( line, "detected dead child (pid=%ld), status %d\n%c",
                      (long) pid, status, 0 );
         }
         write( STDERR_FILENO, line, strlen(line) );
index 73d1cdfadfee05455a7dd35897a6766a95d49c61..b923b740ce771d523409ff2d454d92b840b66da1 100644 (file)
 // Initial revision
 //
 //
-
 #ifndef _SIGNAL_HH
 #define _SIGNAL_HH
 
-#include "config.h"
-
-#if HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-
 #if defined(__GNUC__) || defined(__GNUG__)
 #pragma interface
 #else
@@ -84,6 +77,14 @@ extern "C" {
   typedef SIGRETTYPE SigFunc( SIGPARAM );
 }
 
+#ifndef HAS_PSIGNAL
+void
+psignal( int sig, const char* msg );
+  // purpose: print message, colon, space, signal name and LF.
+  // paramtr: sig (IN): signal number
+  //          msg (IN): message to prepend
+#endif // ! HAS_PSIGNAL
+
 SigFunc*
 Signal( int signo, SigFunc* newhandler, bool doInterrupt );
   // purpose: install reliable signals
index 129e6d1c2d4e3132f7323c0dd1e398b19226de52..033ffe7adb4b2b8ad9efcce01c6142c1529d5bcd 100644 (file)
@@ -60,6 +60,9 @@
 
 #include "convert.hh"
 
+static const char* RCS_ID =
+    "$Id$";
+
 int
 setSocketBuffers( int sockfd, int size )
 // purpose: set socket buffers for both directions to the specified size
@@ -92,7 +95,7 @@ getSocketNoDelay( int sockfd )
 //         -1, if an error occurred (e.g. datagram socket)
 {
     int delay = 0;
-    socklen_t len = sizeof(delay);
+    SOCKLEN len = sizeof(delay);
     if ( getsockopt( sockfd, IPPROTO_TCP, TCP_NODELAY,
                      (char*) &delay, &len ) == -1 ) {
         perror( "# getsockopt( TCP_NODELAY ) failed" );
index 29a53d116890f5211ea07ccc3eb695fb2276c78c..55fca054341791d29d2032228a2744bc3c5efc0b 100644 (file)
 #pragma implementation
 #endif
 
-#include "config.h"
-//#include <assert.h>
+#include <assert.h>
 #include "squid-tlv.hh"
 
+static const char* RCS_ID =
+    "$Id$";
+
 SquidTLV::SquidTLV( SquidMetaType _type, size_t _size, void* _data )
         :next(0),size(_size)
 {