X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=src%2Frrd_xport.c;h=aecd7f373bd483f77495dbf38cb075344bcbc3a9;hp=d92afb1afe6d88b84aa1f08c7119414a153a5553;hb=9584450afaaba1686d2b27b6436743339737a789;hpb=56d67cdd0c5b2c27c9242a3d5810c7184917f663 diff --git a/src/rrd_xport.c b/src/rrd_xport.c index d92afb1..aecd7f3 100644 --- a/src/rrd_xport.c +++ b/src/rrd_xport.c @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.4.0 Copyright by Tobi Oetiker, 1997-2009 + * RRDtool 1.4.3 Copyright by Tobi Oetiker, 1997-2010 **************************************************************************** * rrd_xport.c export RRD data ****************************************************************************/ @@ -58,7 +58,6 @@ int rrd_xport( time_t start_tmp = 0, end_tmp = 0; rrd_time_value_t start_tv, end_tv; char *parsetime_error = NULL; - char *opt_daemon = NULL; struct option long_options[] = { {"start", required_argument, 0, 's'}, @@ -114,15 +113,15 @@ int rrd_xport( break; case 'd': { - if (opt_daemon != NULL) + if (im.daemon_addr != NULL) { rrd_set_error ("You cannot specify --daemon " "more than once."); return (-1); } - opt_daemon = strdup(optarg); - if (opt_daemon == NULL) + im.daemon_addr = strdup(optarg); + if (im.daemon_addr == NULL) { rrd_set_error("strdup error"); return -1; @@ -169,8 +168,7 @@ int rrd_xport( } { /* try to connect to rrdcached */ - int status = rrdc_connect(opt_daemon); - if (opt_daemon) free(opt_daemon); + int status = rrdc_connect(im.daemon_addr); if (status != 0) return status; } @@ -286,7 +284,7 @@ int rrd_xport_fn( free(step_list); *start = im->start - im->start % (*step); - *end = im->end - im->end % (*step); + *end = im->end - im->end % (*step) + (*step); /* room for rearranged data */