On 07/10/2012 04:12 PM, Stefan Weil wrote:
Am 10.07.2012 22:53, schrieb Anthony Liguori:
On 07/08/2012 06:51 AM, blauwir...@gmail.com wrote:
From: Blue Swirl<blauwir...@gmail.com>
Replace %m format with explicit call to standard strerror().
Signed-off-by: Blue Swirl<blauwir...@gmail.com>
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.
Regards,
Anthony Liguori
Extract from the Linux manpage PRINTF(3):
m (Glibc extension.) Print output of strerror(errno). No argument is required.
You're reading the docs too literally:
http://sourceware.org/git/?p=glibc.git;a=blob;f=stdio-common/vfprintf.c;h=d5690342536bc8cf948c786f663bb63f73f91f3a;hb=HEAD#l966
It uses strerror_r() and is thread-safe. Converting to strerror() removes that
safety.
Regards,
Anthony Liguori