From: Kevin Wolf <kwolf@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: zhanghailiang <zhang.zhanghailiang@huawei.com>,
qemu-trivial@nongnu.org, Li Liu <john.liuli@huawei.com>,
Michael Tokarev <mjt@tls.msk.ru>,
qemu-devel@nongnu.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH] block/vvfat.c: remove debugging code to reinit stderr if NULL
Date: Tue, 19 Aug 2014 14:25:04 +0200 [thread overview]
Message-ID: <20140819122504.GE4638@noname.redhat.com> (raw)
In-Reply-To: <53F33DE0.9040700@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1062 bytes --]
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 #2: Type: application/pgp-signature, Size: 836 bytes --]
prev parent reply other threads:[~2014-08-19 12:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-18 11:41 [Qemu-devel] [PATCH] block/vvfat.c: remove debugging code to reinit stderr if NULL Michael Tokarev
2014-08-18 11:45 ` Peter Maydell
2014-08-19 11:58 ` Kevin Wolf
2014-08-19 12:02 ` Peter Maydell
2014-08-19 12:06 ` Eric Blake
2014-08-19 12:25 ` Kevin Wolf [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140819122504.GE4638@noname.redhat.com \
--to=kwolf@redhat.com \
--cc=eblake@redhat.com \
--cc=john.liuli@huawei.com \
--cc=mjt@tls.msk.ru \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=stefanha@redhat.com \
--cc=zhang.zhanghailiang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).