diff --git a/src/rrd_last.c b/src/rrd_last.c
index ff9e7b4f833f7404356a295fe94ee510e9179d63..90bcae7afc608997f5a1709f3ee066ae7fe2356e 100644 (file)
--- a/src/rrd_last.c
+++ b/src/rrd_last.c
/*****************************************************************************
/*****************************************************************************
- * RRDtool 1.4.0 Copyright by Tobi Oetiker, 1997-2009
+ * RRDtool 1.4.3 Copyright by Tobi Oetiker, 1997-2010
*****************************************************************************
* rrd_last.c
*****************************************************************************
*****************************************************************************
* rrd_last.c
*****************************************************************************
char **argv)
{
char *opt_daemon = NULL;
char **argv)
{
char *opt_daemon = NULL;
- int status;
+ time_t lastupdate;
optind = 0;
opterr = 0; /* initialize getopt */
optind = 0;
opterr = 0; /* initialize getopt */
return (-1);
}
return (-1);
}
- status = rrdc_flush_if_daemon(opt_daemon, argv[optind]);
- if (opt_daemon) free(opt_daemon);
- if (status) return (-1);
+ rrdc_connect (opt_daemon);
+ if (rrdc_is_connected (opt_daemon))
+ lastupdate = rrdc_last (argv[optind]);
+
+ else
+ lastupdate = rrd_last_r(argv[optind]);
- return (rrd_last_r (argv[optind]));
+ if (opt_daemon) free(opt_daemon);
+ return (lastupdate);
}
time_t rrd_last_r(
}
time_t rrd_last_r(