]> git.gsnw.org Git - fping.git/commitdiff
Fix double entries with fping -u and unreachable hosts
authorDavid Schweikert <dws@open.ch>
Fri, 13 Jun 2014 06:07:08 +0000 (08:07 +0200)
committerDavid Schweikert <dws@open.ch>
Fri, 13 Jun 2014 06:07:08 +0000 (08:07 +0200)
ChangeLog
ci/test-10-option-u-v.pl
src/fping.c

index 7ead554da45e2125dbaf8e16dd612203323d850d..06728dafb703e6062a1067bceb73a69e87c84d1b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+UNRELEASED
+  * Fix double entries with fping -u and unreachable hosts
+
 2014-05-03  David Schweikert  <david@schweikert.ch>
   * Version 3.10
   * Fix confusing error message with -g and IPv6 addresses (#58, reported by Axel Beckert)
index f5ef83bb8c843e7046f0abd11a33f561be79797f..5c0e2616710233719fc9913d2b525ba83a9a128c 100755 (executable)
@@ -17,7 +17,7 @@ $cmd->stderr_is_eq("");
 {
 my $cmd = Test::Command->new(cmd => "fping -v");
 $cmd->exit_is_num(0);
-$cmd->stdout_like(qr{ping: Version 3\.\d+
+$cmd->stdout_like(qr{ping: Version 3\.\d+(-rc\d+)?
 fping: comments to david\@schweikert\.ch
 });
 $cmd->stderr_is_eq("");
index 43cac42174d18defcf9dd83dc6648d7c4d025b66..977a8ac836702ec208bbbcbfdd27ab6011a51048 100644 (file)
@@ -1440,12 +1440,8 @@ int send_ping( int s, HOST_ENTRY *h )
         && errno != EHOSTDOWN
 #endif
     ) {
-        if( verbose_flag || unreachable_flag ) {
-            printf( "%s", h->host );
-            if( verbose_flag )
-                printf( " error while sending ping: %s\n", strerror( errno ) );
-            
-            printf( "\n" );
+        if( verbose_flag ) {
+            print_warning( "%s: error while sending ping: %s\n", h->host, strerror( errno ) );
         }
         
         if( !loop_flag )