summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ad2c0b1)
raw | patch | inline | side by side (parent: ad2c0b1)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 14 Mar 2011 08:22:46 +0000 (08:22 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 14 Mar 2011 08:22:46 +0000 (08:22 +0000) |
program/src/rrd_client.c | patch | blob | history | |
program/src/rrd_graph.c | patch | blob | history | |
program/src/rrd_open.c | patch | blob | history | |
program/src/rrd_update.c | patch | blob | history |
index 29d1d29989ea3066d201fcbdc037b978637cac47..e3790f6b24e2ab8177337cd00a998f16fd5708e2 100644 (file)
--- a/program/src/rrd_client.c
+++ b/program/src/rrd_client.c
return 0;
else if (daemon_addr == NULL)
{
+ char *addr = getenv(ENV_RRDCACHED_ADDRESS);
/* here we have to handle the case i.e.
* UPDATE --daemon ...; UPDATEV (no --daemon) ...
* In other words: we have a cached connection,
* but it is not specified in the current command.
* Daemon is only implied in this case if set in ENV
*/
- if (getenv(ENV_RRDCACHED_ADDRESS) != NULL)
+ if (addr != NULL && ! strcmp(addr,""))
return 1;
else
return 0;
if (addr == NULL)
addr = getenv (ENV_RRDCACHED_ADDRESS);
- if (addr == NULL)
+ if (addr == NULL || ! strcmp(addr,""))
+ addr = NULL;
return 0;
pthread_mutex_lock(&lock);
index d166f073cbf55408f2cd99b742c9ace7c4d4d16b..fa8f0f41a451e37936fe73e5c13d98be42bc25ad 100644 (file)
--- a/program/src/rrd_graph.c
+++ b/program/src/rrd_graph.c
if (im->second_axis_legend[0] != '\0') {
Xvertical2 = im->text_prop[TEXT_PROP_UNIT].size * 2;
}
+ else{
+ Xvertical2 = Xspacing;
+ }
if (im->title[0] != '\0') {
/* The title is placed "inbetween" two text lines so it
}
else{
// we have no title; get a little clearing from the top
- Ytitle = 1.5 * Yspacing;
+ Ytitle = Yspacing;
}
if (elements) {
/* reserve space for padding below the graph */
if (im->extra_flags & NOLEGEND) {
- Ymain -= Yspacing;
+ Ymain -= 0.5*Yspacing;
}
if (im->watermark[0] != '\0') {
}
/* reserve space for padding below the graph */
if (im->extra_flags & NOLEGEND) {
- im->yimg += Yspacing;
+ im->yimg += 0.5*Yspacing;
}
if (im->watermark[0] != '\0') {
diff --git a/program/src/rrd_open.c b/program/src/rrd_open.c
index 5f3723f30cef086d44c6bab4a3c434b1d74e6507..7c508ff27cfda33ed9bab64c7b65fae9e4e0a8e8 100644 (file)
--- a/program/src/rrd_open.c
+++ b/program/src/rrd_open.c
if((rrd_file->pos + count) > old_size)
{
- rrd_set_error("attempting to write beyond end of file");
+ rrd_set_error("attempting to write beyond end of file (%ld + %ld > %ld)",rrd_file->pos, count, old_size);
return -1;
}
memcpy(rrd_simple_file->file_start + rrd_file->pos, buf, count);
index dbf74df6629611472e5c90af4f530ce36583f338..c5917c0b93158fb93cb6963b19b1069128685cd9 100644 (file)
--- a/program/src/rrd_update.c
+++ b/program/src/rrd_update.c
}
opt_daemon = getenv (ENV_RRDCACHED_ADDRESS);
- if (opt_daemon != NULL) {
+ if (opt_daemon != NULL && ! strcmp(opt_daemon,"")) {
rrd_set_error ("The \"%s\" environment variable is defined, "
"but \"%s\" cannot work with rrdcached. Either unset "
"the environment variable or use \"update\" instead.",
ENV_RRDCACHED_ADDRESS, argv[0]);
goto end_tag;
}
-
+
/* need at least 2 arguments: filename, data. */
if (argc - optind < 2) {
rrd_set_error("Not enough arguments");