diff --git a/program/src/rrd_last.c b/program/src/rrd_last.c
index b9caa64196ca4b59d5ecd57860b6992f9a7ef462..78ba5a360823dfa16d235fe1073cbdc9a0a62969 100644 (file)
--- a/program/src/rrd_last.c
+++ b/program/src/rrd_last.c
time_t
rrd_last(int argc, char **argv)
{
time_t
rrd_last(int argc, char **argv)
{
- FILE *in_file;
time_t lastup;
time_t lastup;
- rrd_t rrd;
-
if(argc < 2){
rrd_set_error("please specify an rrd");
return(-1);
}
if(argc < 2){
rrd_set_error("please specify an rrd");
return(-1);
}
- if(rrd_open(argv[1], &in_file, &rrd, RRD_READONLY)==-1){
+
+ lastup = rrd_last_r(argv[1]);
+
+ return(lastup);
+}
+
+
+time_t
+rrd_last_r(char *filename)
+{
+ FILE *in_file;
+ time_t lastup;
+
+ rrd_t rrd;
+
+ if(rrd_open(filename, &in_file, &rrd, RRD_READONLY)==-1){
return(-1);
}
lastup = rrd.live_head->last_up;
return(-1);
}
lastup = rrd.live_head->last_up;
fclose(in_file);
return(lastup);
}
fclose(in_file);
return(lastup);
}
-
-