From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:32952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sohud-0001wF-Qw for qemu-devel@nongnu.org; Tue, 10 Jul 2012 17:24:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sohuc-0008Ho-0H for qemu-devel@nongnu.org; Tue, 10 Jul 2012 17:24:03 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:38088) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sohub-0008HX-Q1 for qemu-devel@nongnu.org; Tue, 10 Jul 2012 17:24:01 -0400 Received: by pbbro12 with SMTP id ro12so891106pbb.4 for ; Tue, 10 Jul 2012 14:23:59 -0700 (PDT) Message-ID: <4FFC9D6C.6090306@codemonkey.ws> Date: Tue, 10 Jul 2012 16:23:56 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <4FFC9643.7020509@codemonkey.ws> <4FFC9AAE.50609@weilnetz.de> In-Reply-To: <4FFC9AAE.50609@weilnetz.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 4/5] Avoid unportable %m format List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: Blue Swirl , qemu-devel@nongnu.org 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, blauwirbel@gmail.com wrote: >>> From: Blue Swirl >>> >>> Replace %m format with explicit call to standard strerror(). >>> >>> Signed-off-by: Blue Swirl >> >> 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