1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

polldaemon: ret invalid cmd for negative interval

Negative intervals are not supported.
This commit is contained in:
Zdenek Kabelac 2014-04-10 10:08:09 +02:00
parent a8d63994ea
commit 45f45c9932
2 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.107 -
==================================
Return invalid command when specifying negative polling interval.
Version 2.02.106 - 10th April 2014
==================================

View File

@ -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);