[rrd-developers] problem in rrd_update

Edwyn Stapel (ELN) Edwyn.Stapel at eln.ericsson.se
Thu May 3 11:10:43 MEST 2001


Hello,

i've gotten the lib file working in my program after a hard long strugle.
i'm planing on using rrd_create, rrd_update and rrd_graph.

now the problem is after getting rrd to create the database i'm trying to update it with some test data.

/* filling up the array */
char * cmdList[4;
cmdList[0] = "rrdtool";
cmdList[1] = "update";
cmdList[2] = "test.rrd";
cmdList[3] = "987957210:4000";

/* updating db */
rrd_update(3, &cmdList[1]);

up till now everything is working fine but when entering the rrd_update
i'm getting a page fault error when going through the second time in the while loop;

while (1) {
	static struct option long_options[] =
	{
	    {"template",      required_argument, 0, 't'},
	    {0,0,0,0}
	};
	int option_index = 0;
	int opt;
	opt = getopt_long(argc, argv, "t:", 
			  long_options, &option_index);
	
	if (opt == EOF)
	  break;
	
	switch(opt) {
	case 't':
	    template = optarg;
	    break;

	case '?':
	    rrd_set_error("unknown option '%s'",argv[optind-1]);
            rrd_free(&rrd);
	    return(-1);
	}
    }

i have no clue why it would go wrong at this point
going through the second time at the 
opt = getopt - a page fault is generated
is there away to by pass this problem?

Regards,

Edwyn Stapel

--
Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-developers
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-developers mailing list