Blame SOURCES/0003-tools-remove-errx-from-info-commands.patch

ee8dc1
From 4794812cc98c8783921f534d20dae8b44f3826d2 Mon Sep 17 00:00:00 2001
ee8dc1
From: Sumit Bose <sbose@redhat.com>
ee8dc1
Date: Mon, 15 Apr 2019 17:57:37 +0200
ee8dc1
Subject: [PATCH 3/7] tools: remove errx from info commands
ee8dc1
ee8dc1
Related to https://bugzilla.redhat.com/show_bug.cgi?id=1588596
ee8dc1
---
ee8dc1
 tools/info.c | 21 ++++++++++++++-------
ee8dc1
 1 file changed, 14 insertions(+), 7 deletions(-)
ee8dc1
ee8dc1
diff --git a/tools/info.c b/tools/info.c
ee8dc1
index e7e20ad..c63e0ff 100644
ee8dc1
--- a/tools/info.c
ee8dc1
+++ b/tools/info.c
ee8dc1
@@ -162,21 +162,28 @@ adcli_tool_info (adcli_conn *unused,
ee8dc1
 
ee8dc1
 	if (argc == 1)
ee8dc1
 		domain = argv[0];
ee8dc1
-	else if (argc != 0)
ee8dc1
-		errx (2, "specify one user name to create");
ee8dc1
+	else if (argc != 0) {
ee8dc1
+		warnx ("specify one user name to create");
ee8dc1
+		return 2;
ee8dc1
+	}
ee8dc1
 
ee8dc1
 	if (server) {
ee8dc1
 		adcli_disco_host (server, &disco);
ee8dc1
-		if (disco == NULL)
ee8dc1
-			errx (1, "couldn't discover domain controller: %s", server);
ee8dc1
+		if (disco == NULL) {
ee8dc1
+			warnx ("couldn't discover domain controller: %s", server);
ee8dc1
+			return 1;
ee8dc1
+		}
ee8dc1
 		for_host = 1;
ee8dc1
 	} else if (domain) {
ee8dc1
 		adcli_disco_domain (domain, &disco);
ee8dc1
-		if (disco == NULL)
ee8dc1
-			errx (1, "couldn't discover domain: %s", domain);
ee8dc1
+		if (disco == NULL) {
ee8dc1
+			warnx ("couldn't discover domain: %s", domain);
ee8dc1
+			return 1;
ee8dc1
+		}
ee8dc1
 		for_host = 0;
ee8dc1
 	} else {
ee8dc1
-		errx (2, "specify a domain to discover");
ee8dc1
+		warnx ("specify a domain to discover");
ee8dc1
+		return 2;
ee8dc1
 	}
ee8dc1
 
ee8dc1
 	print_info (disco, for_host);
ee8dc1
-- 
ee8dc1
2.20.1
ee8dc1