diff --git a/lnet/utils/lnetctl.c b/lnet/utils/lnetctl.c index 4d4c10d25b..b794a29270 100644 --- a/lnet/utils/lnetctl.c +++ b/lnet/utils/lnetctl.c @@ -3208,7 +3208,8 @@ old_api: return rc; } -static int yaml_lnet_peer_display(yaml_parser_t *reply, bool list_only) +static int yaml_lnet_peer_display(yaml_parser_t *reply, bool list_only, + FILE *fp) { yaml_emitter_t debug; int rc; @@ -3218,7 +3219,7 @@ static int yaml_lnet_peer_display(yaml_parser_t *reply, bool list_only) goto out_err; yaml_emitter_set_indent(&debug, 6); - yaml_emitter_set_output_file(&debug, stdout); + yaml_emitter_set_output_file(&debug, fp); if (list_only) { bool done = false; @@ -3681,7 +3682,7 @@ emitter_error: yaml_emitter_log_error(&output, stderr); rc = -EINVAL; } else { - rc = yaml_lnet_peer_display(&reply, list_only); + rc = yaml_lnet_peer_display(&reply, list_only, fp); if (rc == 0) { msg = yaml_parser_get_reader_error(&reply); /* If we didn't find any peers just be silent */