Skip to contentSkip to conversation

master - lvmpolld: don't return success on invalid option

PATCH okozina 1 participant 1 message May 15, 2015

lore
Share & tools
lore

okozina

author
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d4317c040635a67c62df95bd102e03575d49f09d
Commit:        d4317c040635a67c62df95bd102e03575d49f09d
Parent:        d34de2d91270a1f3cd427e1dab4a6df8789de7e5
Author:        Ondrej Kozina <[email protected]>
AuthorDate:    Fri May 15 19:28:23 2015 +0200
Committer:     Ondrej Kozina <[email protected]>
CommitterDate: Fri May 15 20:33:40 2015 +0200

lvmpolld: don't return success on invalid option

---
 daemons/lvmpolld/lvmpolld-core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
daemons/lvmpolld/lvmpolld-core.c +2 -2
index a141d77..1a33625 100644
@@ -914,7 +914,7 @@ int main(int argc, char *argv[])
 		.socket_path = getenv("LVM_LVMPOLLD_SOCKET") ?: LVMPOLLD_SOCKET,
 	};
 
-	while ((opt = getopt_long(argc, argv, "?fhVl:p:s:B:t:", long_options, &option_index)) != -1) {
+	while ((opt = getopt_long(argc, argv, "fhVl:p:s:B:t:", long_options, &option_index)) != -1) {
 		switch (opt) {
 		case 0 :
 			if (action < ACTION_MAX) {
@@ -928,7 +928,7 @@ int main(int argc, char *argv[])
 			break;
 		case '?':
 			_usage(argv[0], stderr);
-			exit(EXIT_SUCCESS);
+			exit(EXIT_FAILURE);
 		case 'B': /* --binary */
 			ls.lvm_binary = optarg;
 			server = 1;