Blob Blame History Raw
From 5f543465bb3506b7f4929a426f1c22a9c854cecd Mon Sep 17 00:00:00 2001
From: Jan Friesse <jfriesse@redhat.com>
Date: Wed, 4 Mar 2020 08:53:41 +0100
Subject: [PATCH] quorumtool: exit on invalid expected votes

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
---
 tools/corosync-quorumtool.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/corosync-quorumtool.c b/tools/corosync-quorumtool.c
index 9bef844..44bf181 100644
--- a/tools/corosync-quorumtool.c
+++ b/tools/corosync-quorumtool.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2019 Red Hat, Inc.
+ * Copyright (c) 2009-2020 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -937,6 +937,7 @@ int main (int argc, char *argv[]) {
 				votes = strtol(optarg, &endptr, 0);
 				if ((votes == 0 && endptr == optarg) || votes <= 0) {
 					fprintf(stderr, "New expected votes value was not valid, try a positive number\n");
+					exit(EXIT_FAILURE);
 				} else {
 					command_opt = CMD_SETEXPECTED;
 				}
-- 
1.8.3.1