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

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