diff options
-rw-r--r-- | networking/ping.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/networking/ping.c b/networking/ping.c index cdfb297e9..e70bb7e72 100644 --- a/networking/ping.c +++ b/networking/ping.c | |||
@@ -66,8 +66,9 @@ | |||
66 | //config: default y | 66 | //config: default y |
67 | //config: depends on PING || PING6 | 67 | //config: depends on PING || PING6 |
68 | //config: help | 68 | //config: help |
69 | //config: Make the output from the ping applet include statistics, and at the | 69 | //config: With this option off, ping will say "HOST is alive!" |
70 | //config: same time provide full support for ICMP packets. | 70 | //config: or terminate with SIGALRM in 5 seconds otherwise. |
71 | //config: No command-line options will be recognized. | ||
71 | 72 | ||
72 | /* Needs socket(AF_INET, SOCK_RAW, IPPROTO_ICMP), therefore BB_SUID_MAYBE: */ | 73 | /* Needs socket(AF_INET, SOCK_RAW, IPPROTO_ICMP), therefore BB_SUID_MAYBE: */ |
73 | //applet:IF_PING(APPLET(ping, BB_DIR_BIN, BB_SUID_MAYBE)) | 74 | //applet:IF_PING(APPLET(ping, BB_DIR_BIN, BB_SUID_MAYBE)) |
@@ -236,8 +237,6 @@ static void ping4(len_and_sockaddr *lsa) | |||
236 | break; | 237 | break; |
237 | } | 238 | } |
238 | } | 239 | } |
239 | if (ENABLE_FEATURE_CLEAN_UP) | ||
240 | close(pingsock); | ||
241 | } | 240 | } |
242 | 241 | ||
243 | #if ENABLE_PING6 | 242 | #if ENABLE_PING6 |
@@ -280,8 +279,6 @@ static void ping6(len_and_sockaddr *lsa) | |||
280 | break; | 279 | break; |
281 | } | 280 | } |
282 | } | 281 | } |
283 | if (ENABLE_FEATURE_CLEAN_UP) | ||
284 | close(pingsock); | ||
285 | } | 282 | } |
286 | #endif | 283 | #endif |
287 | 284 | ||
@@ -331,6 +328,8 @@ static int common_ping_main(sa_family_t af, char **argv) | |||
331 | else | 328 | else |
332 | #endif | 329 | #endif |
333 | ping4(lsa); | 330 | ping4(lsa); |
331 | if (ENABLE_FEATURE_CLEAN_UP) | ||
332 | close(pingsock); | ||
334 | printf("%s is alive!\n", G.hostname); | 333 | printf("%s is alive!\n", G.hostname); |
335 | return EXIT_SUCCESS; | 334 | return EXIT_SUCCESS; |
336 | } | 335 | } |