diff --git a/ChangeLog b/ChangeLog index 7ead554..06728da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +UNRELEASED + * Fix double entries with fping -u and unreachable hosts + 2014-05-03 David Schweikert * Version 3.10 * Fix confusing error message with -g and IPv6 addresses (#58, reported by Axel Beckert) diff --git a/ci/test-10-option-u-v.pl b/ci/test-10-option-u-v.pl index f5ef83b..5c0e261 100755 --- a/ci/test-10-option-u-v.pl +++ b/ci/test-10-option-u-v.pl @@ -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(""); diff --git a/src/fping.c b/src/fping.c index 43cac42..977a8ac 100644 --- a/src/fping.c +++ b/src/fping.c @@ -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 )