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

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