From 3df6f0514fc0ff649fd1a5299a6f8d5e10000edc Mon Sep 17 00:00:00 2001
From: Grzegorz Brzezinski <grzegorz.brzezinski@intel.com>
Date: Fri, 22 Mar 2019 12:35:06 +0100
Subject: [PATCH] pool: fix printing of error messages in pmempool tool

---
 src/tools/pmempool/common.c  | 5 +++--
 src/tools/pmempool/feature.c | 4 ++--
 src/tools/pmempool/info.c    | 4 ++--
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/tools/pmempool/common.c b/src/tools/pmempool/common.c
index 177691a3e..53d189bcb 100644
--- a/src/tools/pmempool/common.c
+++ b/src/tools/pmempool/common.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014-2018, Intel Corporation
+ * Copyright 2014-2019, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -1417,7 +1417,8 @@ util_pool_clear_badblocks(const char *path, int create)
 	}
 
 	if (badblocks_clear_poolset(setp, create)) {
-		ERR("clearing bad blocks in the pool set failed -- '%s'", path);
+		outv_err("clearing bad blocks in the pool set failed -- '%s'",
+			path);
 		errno = EIO;
 		return -1;
 	}
diff --git a/src/tools/pmempool/feature.c b/src/tools/pmempool/feature.c
index f01a00ffc..418a79816 100644
--- a/src/tools/pmempool/feature.c
+++ b/src/tools/pmempool/feature.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018, Intel Corporation
+ * Copyright 2018-2019, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -146,7 +146,7 @@ feature_perform(struct feature_ctx *pfp)
 		printf("%d", ret);
 		return 0;
 	default:
-		ERR("Invalid option.");
+		outv_err("Invalid option.");
 		return -1;
 	}
 }
diff --git a/src/tools/pmempool/info.c b/src/tools/pmempool/info.c
index f375823d1..24f57d28a 100644
--- a/src/tools/pmempool/info.c
+++ b/src/tools/pmempool/info.c
@@ -385,8 +385,8 @@ parse_args(const char *appname, int argc, char *argv[],
 			} else if (strcmp(optarg, "yes") == 0) {
 				argsp->badblocks = PRINT_BAD_BLOCKS_YES;
 			} else {
-				ERR(
-					"'%s' -- invalid argument of the '--bad-blocks' option\n",
+				outv_err(
+					"'%s' -- invalid argument of the '-k/--bad-blocks' option\n",
 					optarg);
 				return -1;
 			}
-- 
GitLab