Changed the health value option letter to 't' instead
of 'h' to avoid conflict with help option.
Don't increment optind unnecessarily.
In the handling code in api-ni.c there was a missing return.
Test-Parameters: trivial
Signed-off-by: Amir Shehata <ashehata@whamcloud.com>
Change-Id: Ib56f19d1781e44297158c64c5b26004220a1db21
Reviewed-on: https://review.whamcloud.com/33074
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Sonia Sharma <sharmaso@whamcloud.com>
Reviewed-by: Doug Oucharek <dougso@me.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet_peer_ni_set_healthv(cfg->rh_nid, value,
cfg->rh_all);
mutex_unlock(&the_lnet.ln_api_mutex);
lnet_peer_ni_set_healthv(cfg->rh_nid, value,
cfg->rh_all);
mutex_unlock(&the_lnet.ln_api_mutex);
}
case IOC_LIBCFS_NOTIFY_ROUTER: {
}
case IOC_LIBCFS_NOTIFY_ROUTER: {
if (rc != 0) {
rc = -errno;
snprintf(err_str,
if (rc != 0) {
rc = -errno;
snprintf(err_str,
- sizeof(err_str), "Can not configure health value");
+ sizeof(err_str), "Can not configure health value: %s",
+ strerror(errno));
}
cYAML_build_error(rc, seq_no, ADD_CMD, name, err_str, err_rc);
}
cYAML_build_error(rc, seq_no, ADD_CMD, name, err_str, err_rc);
int rc, opt;
struct cYAML *err_rc = NULL;
int rc, opt;
struct cYAML *err_rc = NULL;
- const char *const short_options = "h:n:a";
+ const char *const short_options = "t:n:a";
static const struct option long_options[] = {
{ .name = "nid", .has_arg = required_argument, .val = 'n' },
static const struct option long_options[] = {
{ .name = "nid", .has_arg = required_argument, .val = 'n' },
- { .name = "health", .has_arg = required_argument, .val = 'h' },
+ { .name = "health", .has_arg = required_argument, .val = 't' },
{ .name = "all", .has_arg = no_argument, .val = 'a' },
{ .name = NULL } };
{ .name = "all", .has_arg = no_argument, .val = 'a' },
{ .name = NULL } };
case 'n':
nid = optarg;
break;
case 'n':
nid = optarg;
break;
- case 'h':
- if (parse_long(argv[optind++], &healthv) != 0)
+ case 't':
+ if (parse_long(optarg, &healthv) != 0)
healthv = -1;
break;
case 'a':
all = true;
healthv = -1;
break;
case 'a':
all = true;