[CRIU] [PATCH 3/4] criu: unify invalid usage error messages

Kir Kolyshkin kir at openvz.org
Wed Jan 8 19:33:04 PST 2014


* Make "invalid usage" type messages uniform
* Use pr_msg() not pr_err(), as we don't want to clutter output
  with useless information like (crtools.c:123).

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 crtools.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/crtools.c b/crtools.c
index 6a16f89..efc65b4 100644
--- a/crtools.c
+++ b/crtools.c
@@ -71,7 +71,7 @@ static int parse_ns_string(const char *ptr)
 	return 0;
 
 bad_ns:
-	pr_err("Unknown namespace '%s'\n", ptr);
+	pr_msg("Error: unknown namespace: %s\n", ptr);
 	return -1;
 }
 
@@ -376,7 +376,7 @@ int main(int argc, char *argv[])
 	if (!strcmp(argv[optind], "dedup"))
 		return cr_dedup() != 0;
 
-	pr_msg("Unknown command \"%s\"\n", argv[optind]);
+	pr_msg("Error: unknown command: %s\n", argv[optind]);
 usage:
 	pr_msg("\n"
 "Usage:\n"
@@ -468,7 +468,7 @@ usage:
 	return 1;
 
 opt_pid_missing:
-	pr_msg("No pid specified (-t option missing)\n");
+	pr_msg("Error: pid not specified\n");
 	return 1;
 
 bad_arg:
-- 
1.8.1.4



More information about the CRIU mailing list