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

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