]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
fix code protected by USE_ICMP
authorwessels <>
Wed, 4 Jun 1997 10:32:58 +0000 (10:32 +0000)
committerwessels <>
Wed, 4 Jun 1997 10:32:58 +0000 (10:32 +0000)
src/icmp.cc
src/net_db.cc

index 26d4a86e2e1d575565b4cfde8e7803d55f87351e..2bc346b0f3a644dfb39d99df3aa239190e4b639b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: icmp.cc,v 1.35 1997/04/30 03:12:08 wessels Exp $
+ * $Id: icmp.cc,v 1.36 1997/06/04 04:32:58 wessels Exp $
  *
  * DEBUG: section 37    ICMP Routines
  * AUTHOR: Duane Wessels
@@ -50,11 +50,11 @@ typedef struct _icmpQueueData {
 
 static icmpQueueData *IcmpQueueHead = NULL;
 
-static void icmpRecv _PARAMS((int, void *));
+static PF icmpRecv;
 static void icmpQueueSend _PARAMS((pingerEchoData * pkt,
        int len,
        void          (*free_func) _PARAMS((void *))));
-static void icmpSend _PARAMS((int fd, icmpQueueData * queue));
+static PF icmpSend;
 static void icmpHandleSourcePing _PARAMS((const struct sockaddr_in * from, const char *buf));
 
 static void
@@ -77,10 +77,7 @@ icmpRecv(int unused1, void *unused2)
     static int fail_count = 0;
     pingerReplyData preply;
     static struct sockaddr_in F;
-    commSetSelect(icmp_sock,
-       COMM_SELECT_READ,
-       icmpRecv,
-       -1, 0);
+    commSetSelect(icmp_sock, COMM_SELECT_READ, icmpRecv, NULL, 0);
     memset(&preply, '\0', sizeof(pingerReplyData));
     n = recv(icmp_sock,
        (char *) &preply,
@@ -132,15 +129,13 @@ icmpQueueSend(pingerEchoData * pkt,
     q->free_func = free_func;
     for (H = &IcmpQueueHead; *H; H = &(*H)->next);
     *H = q;
-    commSetSelect(icmp_sock,
-       COMM_SELECT_WRITE,
-       icmpSend,
-       IcmpQueueHead, 0);
+    commSetSelect(icmp_sock, COMM_SELECT_WRITE, icmpSend, IcmpQueueHead, 0);
 }
 
 static void
-icmpSend(int fd, icmpQueueData * queue)
+icmpSend(int fd, void *data)
 {
+    icmpQueueData *queue = data;
     int x;
     while ((queue = IcmpQueueHead)) {
        x = send(icmp_sock,
@@ -165,15 +160,9 @@ icmpSend(int fd, icmpQueueData * queue)
     }
     /* Reinstate handler if needed */
     if (IcmpQueueHead) {
-       commSetSelect(fd,
-           COMM_SELECT_WRITE,
-           icmpSend,
-           IcmpQueueHead, 0);
+       commSetSelect(fd, COMM_SELECT_WRITE, icmpSend, IcmpQueueHead, 0);
     } else {
-       commSetSelect(fd,
-           COMM_SELECT_WRITE,
-           NULL,
-           NULL, 0);
+       commSetSelect(fd, COMM_SELECT_WRITE, NULL, NULL, 0);
     }
 }
 
@@ -302,10 +291,7 @@ icmpOpen(void)
        _exit(1);
     }
     comm_close(child_sock);
-    commSetSelect(icmp_sock,
-       COMM_SELECT_READ,
-       icmpRecv,
-       -1, 0);
+    commSetSelect(icmp_sock, COMM_SELECT_READ, icmpRecv, NULL, 0);
     commSetTimeout(icmp_sock, -1, NULL, NULL);
     debug(29, 0, "Pinger socket opened on FD %d\n", icmp_sock);
 #endif
index ecf4e07b70c00ca03e7719883a941cb89eb13ad6..c220a61d828a43187193ba423cb4dae2d49af1ca 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: net_db.cc,v 1.36 1997/05/15 23:40:25 wessels Exp $
+ * $Id: net_db.cc,v 1.37 1997/06/04 04:32:59 wessels Exp $
  *
  * DEBUG: section 37    Network Measurement Database
  * AUTHOR: Duane Wessels
@@ -322,7 +322,7 @@ netdbSaveState(void *foo)
     net_db_name *x;
     struct timeval start = current_time;
     int count = 0;
-    sprintf(path, "%s/netdb_state", swappath(0));
+    sprintf(path, "%s/netdb_state", storeSwapDir(0));
     fp = fopen(path, "w");
     if (fp == NULL) {
        debug(50, 1, "netdbSaveState: %s: %s\n", path, xstrerror());
@@ -365,7 +365,7 @@ netdbReloadState(void)
     struct in_addr addr;
     int count = 0;
     struct timeval start = current_time;
-    sprintf(path, "%s/netdb_state", swappath(0));
+    sprintf(path, "%s/netdb_state", storeSwapDir(0));
     fp = fopen(path, "r");
     if (fp == NULL)
        return;