qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [Qemu-devel] [PATCH] block/vvfat.c: remove debugging


From: Kevin Wolf
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] block/vvfat.c: remove debugging code to reinit stderr if NULL
Date: Tue, 19 Aug 2014 14:25:04 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Am 19.08.2014 um 14:06 hat Eric Blake geschrieben:
> On 08/19/2014 05:58 AM, Kevin Wolf wrote:
> > Am 18.08.2014 um 13:41 hat Michael Tokarev geschrieben:
> >> Just log to stderr unconditionally, like other similar code does.
> >>
> 
> >>  
> >> -DLOG(if (stderr == NULL) {
> >> -    stderr = fopen("vvfat.log", "a");
> >> -    setbuf(stderr, NULL);
> >> -})
> >> -
> 
> > 
> > This specific patch isn't as trivial as it might look at the first
> > sight (in other words: it's wrong). The part that you probably missed is
> > that stderr isn't the real one when DEBUG is set:
> > 
> >     #undef stderr
> >     #define stderr STDERR
> >     FILE* stderr = NULL;
> 
> Eeek, that's horrible.  I'd rather see code doing freopen("vvfat.log",
> "a", stderr) than the current horrid mess of redefining stderr away from
> its normal meaning.

I'd vote for just removing this redefine in addition to removing the
above hunk, so that everything ends up on the real stderr. But you have
to do the whole thing and not just half of it.

Kevin

Attachment: pgpnBCGJfiHMP.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]