Skip to contentSkip to conversation

master - polldaemon: ret invalid cmd for negative interval

PATCH Zdenek Kabelac 1 participant 1 message Apr 14, 2014

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=45f45c9932840c4bc2d55a1d016269b3167e0450
Commit:        45f45c9932840c4bc2d55a1d016269b3167e0450
Parent:        a8d63994ea1d7faea83c8a8d79bf36cb8b746ffa
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Thu Apr 10 10:08:09 2014 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Apr 14 12:47:14 2014 +0200

polldaemon: ret invalid cmd for negative interval

Negative intervals are not supported.

---
 WHATS_NEW          |    1 +
 tools/polldaemon.c |    4 +++-
 2 files changed, 4 insertions(+), 1 deletions(-)
WHATS_NEW +1 -0
index 99b8311..100b1cb 100644
@@ -1,5 +1,6 @@
 Version 2.02.107 - 
 ==================================
+  Return invalid command when specifying negative polling interval.
 
 Version 2.02.106 - 10th April 2014
 ==================================
tools/polldaemon.c +3 -1
index 7eeea2c..be8a5a3 100644
@@ -247,8 +247,10 @@ int poll_daemon(struct cmd_context *cmd, const char *name, const char *uuid,
 	parms.aborting = arg_is_set(cmd, abort_ARG);
 	parms.background = background;
 	interval_sign = arg_sign_value(cmd, interval_ARG, SIGN_NONE);
-	if (interval_sign == SIGN_MINUS)
+	if (interval_sign == SIGN_MINUS) {
 		log_error("Argument to --interval cannot be negative");
+		return EINVALID_CMD_LINE;
+	}
 	parms.interval = arg_uint_value(cmd, interval_ARG,
 					find_config_tree_int(cmd, activation_polling_interval_CFG, NULL));
 	parms.wait_before_testing = (interval_sign == SIGN_PLUS);