Andreas Stieger
d8dca9d3c3
- Update to upstream version s20121221 (FATE#316211) - See RELNOTES for full changelog - Removed merges patches: * iputils-pingtypo.diff * iputils-s20101006-capabilities.diff - Updated patches for apply - Remove libsysfs dependency (FATE#316211) OBS-URL: https://build.opensuse.org/request/show/215034 OBS-URL: https://build.opensuse.org/package/show/network:utilities/iputils?expand=0&rev=35
45 lines
980 B
Diff
45 lines
980 B
Diff
From 41e442fea26f20ceb815306777d36361575825cc Mon Sep 17 00:00:00 2001
|
|
From: Hannes Reinecke <hare@suse.de>
|
|
Date: Mon, 26 Aug 2013 13:05:01 +0200
|
|
Subject: Allow ping to be interrupted
|
|
|
|
Signed-off-by: Hannes Reinecke <hare@suse.de>
|
|
---
|
|
ping.c | 9 +++++++++
|
|
1 file changed, 9 insertions(+)
|
|
|
|
diff --git a/ping.c b/ping.c
|
|
index 0357c3d..83a7aad 100644
|
|
--- a/ping.c
|
|
+++ b/ping.c
|
|
@@ -103,6 +103,7 @@ static void usage(void) __attribute__((noreturn));
|
|
static u_short in_cksum(const u_short *addr, int len, u_short salt);
|
|
static void pr_icmph(__u8 type, __u8 code, __u32 info, struct icmphdr *icp);
|
|
static int parsetos(char *str);
|
|
+static void doexit (int);
|
|
|
|
static struct {
|
|
struct cmsghdr cm;
|
|
@@ -262,6 +263,8 @@ main(int argc, char **argv)
|
|
options |= F_SOURCEROUTE;
|
|
}
|
|
}
|
|
+ set_signal(SIGINT, doexit);
|
|
+
|
|
while (argc > 0) {
|
|
target = *argv;
|
|
|
|
@@ -1398,3 +1401,9 @@ void usage(void)
|
|
);
|
|
exit(2);
|
|
}
|
|
+
|
|
+static void doexit(int signo)
|
|
+{
|
|
+ exit (1);
|
|
+}
|
|
+
|
|
--
|
|
1.8.1.4
|
|
|