From 119483c9184d416883c140abd3712d603b9d4cb5 Mon Sep 17 00:00:00 2001 From: Bobi Jam Date: Wed, 10 Jan 2018 08:59:32 +0800 Subject: [PATCH] LU-10480 liblustre: suppress progname prefix in output Makes liblustre tool not prefix the progname before every output. Signed-off-by: Bobi Jam Change-Id: Ic8d4cfa19e739ae15048152ec63d90f4b2959d20 Reviewed-on: https://review.whamcloud.com/30819 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- lustre/utils/liblustreapi.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 7280528..a97ecb5 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -129,11 +129,15 @@ static void error_callback_default(enum llapi_message_level level, int err, static void info_callback_default(enum llapi_message_level level, int err, const char *fmt, va_list ap) { - if (liblustreapi_cmd != NULL) - fprintf(stderr, "%s %s: ", program_invocation_short_name, - liblustreapi_cmd); - else - fprintf(stderr, "%s: ", program_invocation_short_name); + if (err != 0) { + if (liblustreapi_cmd != NULL) { + fprintf(stdout, "%s %s: ", + program_invocation_short_name, + liblustreapi_cmd); + } else { + fprintf(stdout, "%s: ", program_invocation_short_name); + } + } vfprintf(stdout, fmt, ap); } -- 1.8.3.1