mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-11-02 17:11:29 +00:00
cfgtool: Return error when -i doesn't match
Give error message and EXIT_FAILURE return code when -i option doesn't match. Signed-off-by: liangxin1300 <XLiang@suse.com> Reviewed-by: Jan Friesse <jfriesse@redhat.com>
This commit is contained in:
parent
d3224df77c
commit
c02a69a988
@ -110,6 +110,7 @@ linkstatusget_do (char *interface_name, int brief)
|
||||
char stat_ch;
|
||||
char *str;
|
||||
totem_transport_t transport_number = TOTEM_TRANSPORT_KNET;
|
||||
int no_match = 1;
|
||||
|
||||
printf ("Printing link status.\n");
|
||||
result = corosync_cfg_initialize (&handle, NULL);
|
||||
@ -201,6 +202,7 @@ linkstatusget_do (char *interface_name, int brief)
|
||||
}
|
||||
|
||||
if (show_current_iface) {
|
||||
no_match = 0;
|
||||
printf ("LINK ID %s\n", interface_names[i]);
|
||||
printf ("\taddr\t= %s\n", cur_iface_name_space + 1);
|
||||
/*
|
||||
@ -270,6 +272,12 @@ linkstatusget_do (char *interface_name, int brief)
|
||||
}
|
||||
}
|
||||
|
||||
/* No match for value of -i option */
|
||||
if (no_match) {
|
||||
rc = EXIT_FAILURE;
|
||||
fprintf(stderr, "Can't match any IP address or link id\n");
|
||||
}
|
||||
|
||||
for (i = 0; i < interface_count; i++) {
|
||||
free(interface_status[i]);
|
||||
free(interface_names[i]);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user