[Top][All Lists]

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

Re: [Qemu-devel] [PATCH 4/5] Avoid unportable %m format

From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH 4/5] Avoid unportable %m format
Date: Tue, 10 Jul 2012 23:12:14 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20120613 Iceowl/1.0b1 Icedove/3.0.11

Am 10.07.2012 22:53, schrieb Anthony Liguori:
On 07/08/2012 06:51 AM, address@hidden wrote:
From: Blue Swirl<address@hidden>

Replace %m format with explicit call to standard strerror().

Signed-off-by: Blue Swirl<address@hidden>

I would expect '%m' to be thread safe whereas strerror() isn't. I don't think this change is actually good.

You'd need to do something more clever with strerror_r() to be equivalent.


Anthony Liguori

Extract from the Linux manpage PRINTF(3):

m (Glibc extension.) Print output of strerror(errno). No argument is required.

The patch should result in identical behaviour with Glibc.
It improves the situation for all platforms which don't use Glibc.

In theory, strerror_r() might be more correct, but in the typical practical
scenarios (error output before abort) it is not really needed.


Stefan Weil

reply via email to

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