I too had a lockup problem, under Solaris. The problem appeared when the
end time was greater that the last datapoint in the file. Do the problems
go away if you decrease the end time?
Here's my fix, along with another that fixes calling the rrd_* routines
multiple times within a C program. Hope this helps.
--- src/rrd_create.c.orig Thu Feb 22 06:02:47 2001
+++ src/rrd_create.c Thu Nov 29 12:42:13 2001
@@ -16,6 +16,8 @@
struct time_value last_up_tv;
char *parsetime_error = NULL;
+
+ optind = 0;
/* init last_up */
last_up = time(NULL)-10;
/* init rrd clean */
--- src/rrd_fetch.c.orig Thu Feb 22 06:02:47 2001
+++ src/rrd_fetch.c Thu Nov 29 12:41:07 2001
@@ -31,6 +31,8 @@
struct time_value start_tv, end_tv;
char *parsetime_error = NULL;
+ optind = 0;
+
/* init start and end time */
parsetime("end-24h", &start_tv);
parsetime("now", &end_tv);
@@ -254,8 +256,8 @@
- (rrd.live_head->last_up % *step));
rra_start_time = (rra_end_time
- ( *step * (rrd.rra_def[chosen_rra].row_cnt-1)));
- start_offset = (*start - rra_start_time) / (long)*step;
- end_offset = (rra_end_time - *end ) / (long)*step;
+ start_offset = (long)(*start - rra_start_time) / (long)*step;
+ end_offset = (long)(rra_end_time - *end ) / (long)*step;
#ifdef DEBUG
fprintf(stderr,"rra_start %lu, rra_end %lu, start_off %li, end_off
%li\n",
rra_start_time,rra_end_time,start_offset,end_offset);
--- src/rrd_graph.c.orig Thu Feb 22 06:02:47 2001
+++ src/rrd_graph.c Thu Nov 29 12:41:07 2001
@@ -2799,6 +2799,8 @@
char *parsetime_error = NULL;
int stroff;
+ optind = 0;
+
(*prdata)=NULL;
parsetime("end-24h", &start_tv);
--- src/rrd_restore.c.orig Thu Feb 22 06:02:48 2001
+++ src/rrd_restore.c Thu Nov 29 12:41:27 2001
@@ -330,6 +330,8 @@
char *buf;
char rc = 0;
+ optind = 0;
+
/* init rrd clean */
rrd_init(&rrd);
if (argc<3) {
--- src/rrd_tune.c.orig Thu Feb 22 06:02:48 2001
+++ src/rrd_tune.c Thu Nov 29 12:41:27 2001
@@ -24,6 +24,8 @@
double max;
char dst[DST_SIZE];
+ optind = 0;
+
if(rrd_open(argv[1],&rrd_file,&rrd, RRD_READWRITE)==-1){
return -1;
--- src/rrd_update.c.orig Thu Feb 22 06:02:48 2001
+++ src/rrd_update.c Thu Nov 29 12:43:13 2001
@@ -94,6 +94,8 @@
char *template = NULL;
+ optind = 0;
+
while (1) {
static struct option long_options[] =
{
---
Tom Bertelson "Any sufficient advanced technlogy
GE Card Services is indistinguishable from magic."
[EMAIL PROTECTED] -- Arthur C. Clarke
--
Unsubscribe mailto:[EMAIL PROTECTED]
Help mailto:[EMAIL PROTECTED]
Archive http://www.ee.ethz.ch/~slist/rrd-developers
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi