Skip to content

Commit

Permalink
cmapctl: return EXIT_FAILURE on failure
Browse files Browse the repository at this point in the history
For -g and -d option return EXIT_FAILURE when error occurs (most often
because key does not exist).

Signed-off-by: liangxin1300 <XLiang@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
  • Loading branch information
liangxin1300 authored and jfriesse committed Aug 17, 2020
1 parent fb5e0fa commit 9105d94
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/corosync-cmapctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,7 @@ int main(int argc, char *argv[])
print_key(handle, argv[i], value_len, NULL, type);
} else {
fprintf(stderr, "Can't get key %s. Error %s\n", argv[i], cs_strerror(err));
return (EXIT_FAILURE);
}
}
break;
Expand All @@ -940,6 +941,7 @@ int main(int argc, char *argv[])
err = cmap_delete(handle, argv[i]);
if (err != CS_OK) {
fprintf(stderr, "Can't delete key %s. Error %s\n", argv[i], cs_strerror(err));
return (EXIT_FAILURE);
}
}
break;
Expand Down

0 comments on commit 9105d94

Please sign in to comment.