From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJiCI-0001TE-RN for qemu-devel@nongnu.org; Tue, 19 Aug 2014 08:07:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XJiCD-0000Xz-TK for qemu-devel@nongnu.org; Tue, 19 Aug 2014 08:07:30 -0400 Message-ID: <53F33DE0.9040700@redhat.com> Date: Tue, 19 Aug 2014 06:06:56 -0600 From: Eric Blake MIME-Version: 1.0 References: <1408362096-10482-1-git-send-email-mjt@msgid.tls.msk.ru> <20140819115823.GD4638@noname.redhat.com> In-Reply-To: <20140819115823.GD4638@noname.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1IHBT1afbW6BiG1OGxPLP8QIKoqlSQTrK" Subject: Re: [Qemu-devel] [PATCH] block/vvfat.c: remove debugging code to reinit stderr if NULL List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , Michael Tokarev Cc: qemu-trivial@nongnu.org, Li Liu , qemu-devel@nongnu.org, stefanha@redhat.com, zhanghailiang This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1IHBT1afbW6BiG1OGxPLP8QIKoqlSQTrK Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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. >> >> =20 >> -DLOG(if (stderr =3D=3D NULL) { >> - stderr =3D fopen("vvfat.log", "a"); >> - setbuf(stderr, NULL); >> -}) >> - >=20 > 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 i= s > that stderr isn't the real one when DEBUG is set: >=20 > #undef stderr > #define stderr STDERR > FILE* stderr =3D 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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --1IHBT1afbW6BiG1OGxPLP8QIKoqlSQTrK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJT8z3gAAoJEKeha0olJ0NqdmQIAJqlf++El8Y2+7WwsfjRMRsB twwum1y9VviBEpuSodJreRK4pIevo/Pq9JqxztNSYL0lZBp4adtGYgTSJhEsK84y L6y3zqaQ37AEYNGVDtO104se+7mN4x7hor3LI0qZOclhmGGhGQTY+rxW8pv9bEqu +2HtFktcHwQWXh+71KgZTWNEyK7qwslomk/C9lss/9Igljjvdf3LsjJBA6dHXq1C o9vVzZ1FaXmQIP76VIg3w9pNey2Fy6NtMNclRwBWgHgxDs1Ttdziv5wzDtGp1/uM 60lzpRgFBUaRLXe+spOBAZ7p8tVrTHp8Y3h2qwsclvKvR4V0V9YCJlYYZMgf+2s= =o1ra -----END PGP SIGNATURE----- --1IHBT1afbW6BiG1OGxPLP8QIKoqlSQTrK--