From 121bea1d24c15e951fc06a294d383a62032e15c8 Mon Sep 17 00:00:00 2001 From: David Schweikert Date: Tue, 21 May 2013 22:02:39 +0200 Subject: [PATCH] Fix compatibility issue with FreeBSD (Alexandre Raynaud, Jason Harris, #39) --- ChangeLog | 1 + src/fping.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 861f426..7b63f6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ UNRELEASED * Fix sprint_tm buffer size crash (reported by Japheth Cleaver) * Addded -D flag to print timestamps (Toke Høiland-Jørgensen) * Fix fping6 build on OS X 10.8 (unknown contributor) + * Fix compatibility issue with FreeBSD (Alexandre Raynaud, Jason Harris, #39) * Fping.spec: fix setuid permissions and provides fping6 (Marcus Vinicius Ferreira) 2012-09-04 David Schweikert diff --git a/src/fping.c b/src/fping.c index 240081f..4215215 100644 --- a/src/fping.c +++ b/src/fping.c @@ -1579,7 +1579,12 @@ int send_ping( int s, HOST_ENTRY *h ) ( struct sockaddr* )&h->saddr, sizeof( FPING_SOCKADDR ) ); if( n < 0 || n != ping_pkt_size ) - { + if( + (n < 0 || n != ping_pkt_size) +#if defined( EHOSTDOWN ) + && errno != EHOSTDOWN +#endif + ) { if( verbose_flag || unreachable_flag ) { printf( "%s", h->host );