summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d91c844)
raw | patch | inline | side by side (parent: d91c844)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 31 Oct 2010 12:09:51 +0000 (13:09 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 31 Oct 2010 12:09:51 +0000 (13:09 +0100) |
src/rrdcached.c | patch | blob | history | |
src/target_notification.c | patch | blob | history | |
src/utils_rrdcreate.c | patch | blob | history |
diff --git a/src/rrdcached.c b/src/rrdcached.c
index 34e860ba6dc72ccff994e7dc999ca79682292c63..fb7eb79e8ec50eca5ab5d9273ff349d9fb5dd4cf 100644 (file)
--- a/src/rrdcached.c
+++ b/src/rrdcached.c
int offset;
int status;
int i;
+ time_t t;
assert (0 == strcmp (ds->type, vl->type));
memset (buffer, '\0', buffer_len);
- status = ssnprintf (buffer, buffer_len, "%u", (unsigned int) vl->time);
+ t = CDTIME_T_TO_TIME_T (vl->time);
+ status = ssnprintf (buffer, buffer_len, "%lu", (unsigned long) t);
if ((status < 1) || (status >= buffer_len))
return (-1);
offset = status;
index 96598afd76fd53500948e34dda8bf516726e4371..cb68048b6a8f7c042cdd37bbf7dc3c77a24bd754 100644 (file)
/* Initialize the structure. */
memset (&n, 0, sizeof (n));
n.severity = data->severity;
- n.time = time (NULL);
+ n.time = cdtime ();
sstrncpy (n.message, data->message, sizeof (n.message));
sstrncpy (n.host, vl->host, sizeof (n.host));
sstrncpy (n.plugin, vl->plugin, sizeof (n.plugin));
diff --git a/src/utils_rrdcreate.c b/src/utils_rrdcreate.c
index 4ecec59dae1cdad9d3128b25f241920d888d6fce..5f21a17b8391c40e41de4e531d144d794a1bd359 100644 (file)
--- a/src/utils_rrdcreate.c
+++ b/src/utils_rrdcreate.c
last_up = time (NULL) - 10;
ssnprintf (pdp_step_str, sizeof (pdp_step_str), "%lu", pdp_step);
- ssnprintf (last_up_str, sizeof (last_up_str), "%u", (unsigned int) last_up);
+ ssnprintf (last_up_str, sizeof (last_up_str), "%lu", (unsigned long) last_up);
new_argv[0] = "create";
new_argv[1] = (void *) filename;
char **ds_def;
int ds_num;
int status = 0;
+ time_t last_up;
if (check_create_dir (filename))
return (-1);
memcpy (argv + ds_num, rra_def, rra_num * sizeof (char *));
argv[ds_num + rra_num] = NULL;
+ if (vl->time == 0)
+ last_up = time (NULL) - 10;
+ else
+ last_up = CDTIME_T_TO_TIME_T (vl->time) - 10;
+
assert (vl->time > 10);
status = srrd_create (filename,
(cfg->stepsize > 0) ? cfg->stepsize : vl->interval,
- vl->time - 10,
+ last_up,
argc, (const char **) argv);
free (argv);