Jim Meyering <[EMAIL PROTECTED]> wrote: > Here's a 5-patch series from a week or so ago. > It started out with the aim to avoid some warnings. > Some of those warnings were legitimate. > > At first I was tempted to simply ignore any freopen failure, > thinking that it was so unlikely as to be truly ignorable. > And in addition, most are guarded by "if (O_BINARY &&...", > so wouldn't even be compiled on systems I care about. > However, there are actually many ways in which freopen can > fail, so I wrote xfreopen and used that everywhere. > > Feedback welcome. > I'll wait a day or two, just in case... ... >>From 6fc767036a513dad05c43cca2253e7f0a1c3cde0 Mon Sep 17 00:00:00 2001 > From: Jim Meyering <[EMAIL PROTECTED]> > Date: Sun, 12 Oct 2008 16:09:00 +0200 > Subject: [PATCH] mktemp: diagnose freopen failure > > * src/mktemp [--quiet]: Don't ignore freopen failure. > --- > src/mktemp.c | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/src/mktemp.c b/src/mktemp.c > index 295d134..8998f5c 100644 > --- a/src/mktemp.c > +++ b/src/mktemp.c > @@ -190,7 +190,9 @@ main (int argc, char **argv) > { > /* From here on, redirect stderr to /dev/null. > A diagnostic from getopt_long, above, would still go to stderr. */ > - freopen ("/dev/null", "wb", stderr); > + if (!freopen ("/dev/null", "wb", stderr)) > + error (EXIT_FAILURE, errno, > + _("failed to redirect stderr to /dev/null")); > } > > n_args = argc - optind; > -- > 1.6.0.2.98.gc82e
I've pushed this one. _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils