summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f1b5b86)
raw | patch | inline | side by side (parent: f1b5b86)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 6 Nov 2010 14:04:31 +0000 (15:04 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 6 Nov 2010 14:04:31 +0000 (15:04 +0100) |
src/utils_cmd_flush.c | patch | blob | history |
diff --git a/src/utils_cmd_flush.c b/src/utils_cmd_flush.c
index 0e7b350f581f02f07ccaf234c1ec0c225011b33d..3584f3b71a3c82bd73ec85cd55201422f8a8e1f8 100644 (file)
--- a/src/utils_cmd_flush.c
+++ b/src/utils_cmd_flush.c
int success = 0;
int error = 0;
- int timeout = -1;
+ double timeout = 0.0;
char **plugins = NULL;
int plugins_num = 0;
char **identifiers = NULL;
errno = 0;
endptr = NULL;
- timeout = strtol (opt_value, &endptr, 0);
+ timeout = strtod (opt_value, &endptr);
- if ((endptr == opt_value) || (errno != 0))
+ if ((endptr == opt_value) || (errno != 0) || (!isfinite (timeout)))
{
print_to_socket (fh, "-1 Invalid value for option `timeout': "
"%s\n", opt_value);
sfree (identifiers);
return (-1);
}
- else if (timeout <= 0)
- timeout = -1;
+ else if (timeout < 0.0)
+ {
+ timeout = 0.0;
+ }
}
else
{
int status;
identifier = identifiers[j];
- status = plugin_flush (plugin, timeout, identifier);
+ status = plugin_flush (plugin,
+ DOUBLE_TO_CDTIME_T (timeout),
+ identifier);
if (status == 0)
success++;
else