← Commit list

b5474c48b

Eric Andersen
Eric Andersen
2002-03-20
FAILED Duration: 349s

Subject

Cave to pressure (2 months later). Eliminate using a nested function, which is a purely unremovable gcc-ism... -Erik

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

networking/ping.c+8 -7
@@ -1,6 +1,6 @@
/* vi: set sw=4 ts=4: */
/*
- * $Id: ping.c,v 1.48 2002/02/01 16:54:00 kraai Exp $
+ * $Id: ping.c,v 1.49 2002/03/20 11:59:28 andersen Exp $
* Mini ping implementation for busybox
*
* Copyright (C) 1999 by Randolph Chung <[email protected]>
@@ -175,6 +175,12 @@ static int in_cksum(unsigned short *buf, int sz)
/* simple version */
#ifndef CONFIG_FEATURE_FANCY_PING
+static char *hostname = NULL;
+void noresp(int ign)
+{
+ printf("No response from %s\n", h->h_name);
+ exit(0);
+}
static void ping(const char *host)
{
@@ -184,12 +190,6 @@ static void ping(const char *host)
int pingsock, c;
char packet[DEFDATALEN + MAXIPLEN + MAXICMPLEN];
- void noresp(int ign)
- {
- printf("No response from %s\n", h->h_name);
- exit(0);
- }
-
pingsock = create_icmp_socket();
memset(&pingaddr, 0, sizeof(struct sockaddr_in));
@@ -197,6 +197,7 @@ static void ping(const char *host)
pingaddr.sin_family = AF_INET;
h = xgethostbyname(host);
memcpy(&pingaddr.sin_addr, h->h_addr, sizeof(pingaddr.sin_addr));
+ hostname = h->h_name;
pkt = (struct icmp *) packet;
memset(pkt, 0, sizeof(packet));