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

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