Преглед изворни кода

quorumtool: exit on invalid expected votes

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
Jan Friesse пре 6 година
родитељ
комит
5f543465bb
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      tools/corosync-quorumtool.c

+ 2 - 1
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.
  * All rights reserved.
  *
  *
@@ -937,6 +937,7 @@ int main (int argc, char *argv[]) {
 				votes = strtol(optarg, &endptr, 0);
 				votes = strtol(optarg, &endptr, 0);
 				if ((votes == 0 && endptr == optarg) || votes <= 0) {
 				if ((votes == 0 && endptr == optarg) || votes <= 0) {
 					fprintf(stderr, "New expected votes value was not valid, try a positive number\n");
 					fprintf(stderr, "New expected votes value was not valid, try a positive number\n");
+					exit(EXIT_FAILURE);
 				} else {
 				} else {
 					command_opt = CMD_SETEXPECTED;
 					command_opt = CMD_SETEXPECTED;
 				}
 				}