commit-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-234-gba47e


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-234-gba47e90
Date: Wed, 16 Jan 2013 10:47:10 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  ba47e906562bd24bac4b24f1c6f8ecc29dfacbdc (commit)
      from  41058f573aefc006eabc7c1fb1071b0f23e8ab14 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=ba47e906562bd24bac4b24f1c6f8ecc29dfacbdc


commit ba47e906562bd24bac4b24f1c6f8ecc29dfacbdc
Author: Mats Erik Andersson <address@hidden>
Date:   Wed Jan 16 11:25:11 2013 +0100

    ping, ping6: Error handling.

diff --git a/ChangeLog b/ChangeLog
index 8ec09ee..6c5bc95 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2013-01-16  Guillem Jover  <address@hidden>
+
+       * ping/libping.c (ping_xmit): Do not call perror().
+       Instead return a negative status.
+       * ping/ping.c (send_echo): New variable RC.
+       Abort with a message on any error condition.
+       * ping/ping6.c (ping_xmit): Likewise.
+       (send_echo): Likewise.
+
 2013-01-07  Mats Erik Andersson  <address@hidden>
 
        tftpd: Error handling.
diff --git a/ping/libping.c b/ping/libping.c
index d269150..cd6c016 100644
--- a/ping/libping.c
+++ b/ping/libping.c
@@ -152,7 +152,7 @@ ping_xmit (PING * p)
   i = sendto (p->ping_fd, (char *) p->ping_buffer, buflen, 0,
              (struct sockaddr *) &p->ping_dest.ping_sockaddr, sizeof (struct 
sockaddr_in));
   if (i < 0)
-    perror ("ping: sendto");
+    return -1;
   else
     {
       p->ping_num_xmit++;
diff --git a/ping/ping.c b/ping/ping.c
index 9f51671..5da4d99 100644
--- a/ping/ping.c
+++ b/ping/ping.c
@@ -497,6 +497,7 @@ int
 send_echo (PING * ping)
 {
   size_t off = 0;
+  int rc;
 
   if (PING_TIMING (data_length))
     {
@@ -509,7 +510,12 @@ send_echo (PING * ping)
     ping_set_data (ping, data_buffer, off,
                   data_length > off ? data_length - off : data_length,
                   USE_IPV6);
-  return ping_xmit (ping);
+
+  rc = ping_xmit (ping);
+  if (rc < 0)
+    error (EXIT_FAILURE, errno, "sending packet");
+
+  return rc;
 }
 
 int
diff --git a/ping/ping6.c b/ping/ping6.c
index 2035ec2..ff3f4b7 100644
--- a/ping/ping6.c
+++ b/ping/ping6.c
@@ -384,6 +384,7 @@ static int
 send_echo (PING * ping)
 {
   size_t off = 0;
+  int rc;
 
   if (PING_TIMING (data_length))
     {
@@ -396,7 +397,12 @@ send_echo (PING * ping)
     ping_set_data (ping, data_buffer, off,
                   data_length > off ? data_length - off : data_length,
                   USE_IPV6);
-  return ping_xmit (ping);
+
+  rc = ping_xmit (ping);
+  if (rc < 0)
+    error (EXIT_FAILURE, errno, "sending packet");
+
+  return rc;
 }
 
 static int
@@ -796,7 +802,7 @@ ping_xmit (PING * p)
              (struct sockaddr *) &p->ping_dest.ping_sockaddr6,
              sizeof (p->ping_dest.ping_sockaddr6));
   if (i < 0)
-    perror ("ping: sendto");
+    return -1;
   else
     {
       p->ping_num_xmit++;

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog      |    9 +++++++++
 ping/libping.c |    2 +-
 ping/ping.c    |    8 +++++++-
 ping/ping6.c   |   10 ++++++++--
 4 files changed, 25 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]