On Sun, 8 Jan 2006, Nicola Worthington wrote:
> Date: Sun, 8 Jan 2006 18:07:36 +0000 (GMT)
> From: Nicola Worthington <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED], [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED], [EMAIL PROTECTED]
> Subject: [rrd-developers] Patch to rrd_dump.c to allow output to a filename as
> well as stdout
>
> Dear All,
> Having never submitted a patch before, I was unsure as to where to send it
> to, so I'm taking a best guess at the developers list and Tobi. Please
> correct me if I'm not following protocol. :)
>
> This is a patch to allow rrd_dump to output to a filename if a second
> argument is specified. This makes life a lot easier if you want to use the
> dump functionality in RRDs for example without wanting to do funky stuff
> to capture the output. (Not everyone wants to do output redirection).
>
> The TCL binding has been altered slightly to take this change in to
> account since it was calling the rrd_dump_r method directly instead of
> rrd_dump.
>
> I hope this can be considered for inclusion in the next release. Please
> let me know your thoughts.
+ fprintf(out_file, "</rrd>\n");
rrd_free(&rrd);
fclose(in_file);
+ if (out_file)
+ {
+ fclose(out_file);
+ }
return(0);
}
Shouldn't that check at least be (out_file != stdout)? Otherwise you'll
end up closing stdout.
peter
--
Unsubscribe mailto:[EMAIL PROTECTED]
Help mailto:[EMAIL PROTECTED]
Archive http://lists.ee.ethz.ch/rrd-developers
WebAdmin http://lists.ee.ethz.ch/lsg2.cgi