diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 373312f2..51471e86 100644 --- a/ip/ipaddress.c +++ b/ip/ipaddress.c @@ -697,10 +697,12 @@ static int ipaddr_list_or_flush(int argc, char **argv, int flush) exit(1); } if (filter.flushed == 0) { - if (round == 0) { - fprintf(stderr, "Nothing to flush.\n"); - } else if (show_stats) - printf("*** Flush is complete after %d round%s ***\n", round, round>1?"s":""); + if (show_stats) { + if (round == 0) + printf("Nothing to flush.\n"); + else + printf("*** Flush is complete after %d round%s ***\n", round, round>1?"s":""); + } fflush(stdout); return 0; } diff --git a/ip/ipneigh.c b/ip/ipneigh.c index fa0e41dc..30c7c72d 100644 --- a/ip/ipneigh.c +++ b/ip/ipneigh.c @@ -402,10 +402,12 @@ int do_show_or_flush(int argc, char **argv, int flush) exit(1); } if (filter.flushed == 0) { - if (round == 0) { - fprintf(stderr, "Nothing to flush.\n"); - } else if (show_stats) - printf("*** Flush is complete after %d round%s ***\n", round, round>1?"s":""); + if (show_stats) { + if (round == 0) + printf("Nothing to flush.\n"); + else + printf("*** Flush is complete after %d round%s ***\n", round, round>1?"s":""); + } fflush(stdout); return 0; } diff --git a/ip/iproute.c b/ip/iproute.c index 2a8f3f83..6a2ea05f 100644 --- a/ip/iproute.c +++ b/ip/iproute.c @@ -1209,11 +1209,12 @@ static int iproute_list_or_flush(int argc, char **argv, int flush) exit(1); } if (filter.flushed == 0) { - if (round == 0) { - if (!filter.cloned || do_ipv6 == AF_INET6) - fprintf(stderr, "Nothing to flush.\n"); - } else if (show_stats) - printf("*** Flush is complete after %d round%s ***\n", round, round>1?"s":""); + if (show_stats) { + if (round == 0 && (!filter.cloned || do_ipv6 == AF_INET6)) + printf("Nothing to flush.\n"); + else + printf("*** Flush is complete after %d round%s ***\n", round, round>1?"s":""); + } fflush(stdout); return 0; }