Browse files

Fix ping_test to deal with EINVAL return codes

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information...
1 parent 5856868 commit bd0ed241970b16316641b52ec37e31a611d60b61 @fabbione committed Jan 29, 2013
Showing with 9 additions and 3 deletions.
  1. +9 −3 libknet/ping_test.c
View
12 libknet/ping_test.c
@@ -227,9 +227,15 @@ static void sigint_handler(int signum)
for (i = 0; i < host_ids_entries; i++) {
for (j = 0; j < KNET_MAX_LINK; j++) {
- if (knet_link_get_status(knet_h, host_ids[i], j, &status))
- printf("Unable to get link data: %s\n",strerror(errno));
- if (status.enabled != 1) continue;
+ if (knet_link_get_status(knet_h, host_ids[i], j, &status)) {
+ if (errno != EINVAL) {
+ printf("Unable to get link data: %s\n",strerror(errno));
+ }
+ continue;
+ }
+ if (status.enabled != 1) {
+ continue;
+ }
if (knet_link_set_enable(knet_h, host_ids[i], j, 0))
printf("Unable to remove link: %s\n",strerror(errno));

0 comments on commit bd0ed24

Please sign in to comment.