From 162fd8fc04e565c76085ac16e66d0dbea1e7a5dd Mon Sep 17 00:00:00 2001 From: oetiker Date: Thu, 27 May 2010 06:09:47 +0000 Subject: [PATCH] make the xport command handles the --daemon option properly -- unknown contributor #265 git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@2082 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_xport.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/program/src/rrd_xport.c b/program/src/rrd_xport.c index 063982eb..aecd7f37 100644 --- a/program/src/rrd_xport.c +++ b/program/src/rrd_xport.c @@ -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; } -- 2.30.2