X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_update.c;h=5411840f991b688b27fd8f407e8e661b3d134bed;hb=5a7eb5b62b485b61ddb80a40ef22f4337cf2289f;hp=bccadcaaa80cad4e66f19a03fd7964c423717cf7;hpb=f8b321ed9be936455166a5e9297199e84b048526;p=rrdtool.git diff --git a/src/rrd_update.c b/src/rrd_update.c index bccadca..5411840 100644 --- a/src/rrd_update.c +++ b/src/rrd_update.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.2rc7 Copyright by Tobi Oetiker, 1997-2005 + * RRDtool 1.2.5 Copyright by Tobi Oetiker, 1997-2005 ***************************************************************************** * rrd_update.c RRD Update Function ***************************************************************************** @@ -23,6 +23,7 @@ #include "rrd_rpncalc.h" #include "rrd_is_thread_safe.h" +#include "unused.h" #if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) /* @@ -69,7 +70,12 @@ int LockRRD(FILE *rrd_file); #ifdef HAVE_MMAP info_t *write_RRA_row (rrd_t *rrd, unsigned long rra_idx, unsigned long *rra_current, - unsigned short CDP_scratch_idx, FILE *rrd_file, + unsigned short CDP_scratch_idx, +#ifndef DEBUG +FILE UNUSED(*rrd_file), +#else +FILE *rrd_file, +#endif info_t *pcdp_summary, time_t *rra_time, void *rrd_mmaped_file); #else info_t *write_RRA_row (rrd_t *rrd, unsigned long rra_idx, @@ -89,7 +95,7 @@ int main(int argc, char **argv){ rrd_update(argc,argv); if (rrd_test_error()) { - printf("RRDtool 1.2rc7 Copyright by Tobi Oetiker, 1997-2005\n\n" + printf("RRDtool 1.2.5 Copyright by Tobi Oetiker, 1997-2005\n\n" "Usage: rrdupdate filename\n" "\t\t\t[--template|-t ds-name:ds-name:...]\n" "\t\t\ttime|N:value[:value...]\n\n" @@ -109,6 +115,7 @@ info_t *rrd_update_v(int argc, char **argv) char *template = NULL; info_t *result = NULL; infoval rc; + optind = 0; opterr = 0; /* initialize getopt */ while (1) { static struct option long_options[] = @@ -155,6 +162,7 @@ rrd_update(int argc, char **argv) { char *template = NULL; int rc; + optind = 0; opterr = 0; /* initialize getopt */ while (1) { static struct option long_options[] = @@ -1383,11 +1391,7 @@ _rrd_update(char *filename, char *template, int argc, char **argv, * critical except during the burning cycles. */ if (schedule_smooth) { -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) rrd_file = fopen(filename,"rb+"); -#else - rrd_file = fopen(filename,"r+"); -#endif rra_start = rra_begin; for (i = 0; i < rrd.stat_head -> rra_cnt; ++i) { @@ -1455,7 +1459,12 @@ LockRRD(FILE *rrdfile) #ifdef HAVE_MMAP info_t *write_RRA_row (rrd_t *rrd, unsigned long rra_idx, unsigned long *rra_current, - unsigned short CDP_scratch_idx, FILE *rrd_file, + unsigned short CDP_scratch_idx, +#ifndef DEBUG +FILE UNUSED(*rrd_file), +#else +FILE *rrd_file, +#endif info_t *pcdp_summary, time_t *rra_time, void *rrd_mmaped_file) #else info_t