Skip to contentSkip to conversation

batctl: indicate successful termination when -h is used

PATCH Applied Moritz Warning 2 participants 2 messages Dec 5, 2012 – Dec 15, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batctl: indicate successful termination when -h is used

The return value of batctl -h indicates failure while it should indicate a successful execution.

---
From: Moritz Warning <[email protected]>
Subject: [PATCH] batctl: change return value to indicate successful
termination when -h is used

---
 main.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
main.c +4 -2
index 0a979bd..ea83bbf 100644
@@ -114,8 +114,10 @@ int main(int argc, char **argv)
 		goto err;
 	}
 
-	if (strcmp(argv[1], "-h") == 0)
-		goto err;
+	if (strcmp(argv[1], "-h") == 0) {
+		print_usage();
+		exit(EXIT_SUCCESS);
+	}
 
 	if (strcmp(argv[1], "-v") == 0) {
 		printf("batctl %s [batman-adv: ", SOURCE_VERSION);
#1 lore raw
Quoted 5 lines · On Wednesday, December 05, 2012 16:40:10 Moritz Warning wrote:

The return value of batctl -h indicates failure while it should indicate a successful execution.

Quoted 8 lines

---
From: Moritz Warning <[email protected]>
Subject: [PATCH] batctl: change return value to indicate successful
termination when -h is used

---
 main.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Applied in revision 1932d4e.

Thanks,
Marek