X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_dump.c;h=247e912bcc87f64456b3ce2809895f20656d0d3f;hb=6abd9aa12683af559ac1752bc1958e0e0b930280;hp=0feafd72b87e7eca6613ecd0bac30b7d0c4364c7;hpb=2e3ab4d5b17d1264c1908026df77242aeefb9b18;p=rrdtool.git diff --git a/src/rrd_dump.c b/src/rrd_dump.c index 0feafd7..247e912 100644 --- a/src/rrd_dump.c +++ b/src/rrd_dump.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3rc2 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.1 Copyright by Tobi Oetiker, 1997-2008 ***************************************************************************** * rrd_dump Display a RRD ***************************************************************************** @@ -52,8 +52,7 @@ extern char *tzname[2]; int rrd_dump_opt_r( const char *filename, char *outname, - int opt_noheader -) + int opt_noheader) { unsigned int i, ii, ix, iii = 0; time_t now; @@ -81,11 +80,11 @@ int rrd_dump_opt_r( out_file = stdout; } - if (!opt_noheader){ - fputs("\n", out_file); - fputs - ("\n", - out_file); + if (!opt_noheader) { + fputs("\n", out_file); + fputs + ("\n", + out_file); } fputs("", out_file); fputs("", out_file); @@ -433,7 +432,7 @@ int rrd_dump_r( const char *filename, char *outname) { - return rrd_dump_opt_r(filename,outname,0); + return rrd_dump_opt_r(filename, outname, 0); } int rrd_dump( @@ -442,13 +441,14 @@ int rrd_dump( { int rc; int opt_noheader = 0; + /* init rrd clean */ optind = 0; opterr = 0; /* initialize getopt */ - + while (42) { - int opt; + int opt; int option_index = 0; static struct option long_options[] = { {"no-header", no_argument, 0, 'n'}, @@ -465,9 +465,9 @@ int rrd_dump( opt_noheader = 1; break; - default: + default: rrd_set_error("usage rrdtool %s [--no-header|-n] " - "file.rrd [file.xml]", argv[0]); + "file.rrd [file.xml]", argv[0]); return (-1); break; } @@ -480,11 +480,10 @@ int rrd_dump( } if ((argc - optind) == 2) { - rc = rrd_dump_opt_r(argv[optind], argv[optind+1],opt_noheader); + rc = rrd_dump_opt_r(argv[optind], argv[optind + 1], opt_noheader); } else { - rc = rrd_dump_opt_r(argv[optind], NULL,opt_noheader); + rc = rrd_dump_opt_r(argv[optind], NULL, opt_noheader); } return rc; } -