[Top][All Lists]

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

Re: [PATCH] strerror_r: fix on newer cygwin

From: Eric Blake
Subject: Re: [PATCH] strerror_r: fix on newer cygwin
Date: Thu, 19 May 2011 14:25:15 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10

On 05/19/2011 02:12 PM, Bruno Haible wrote:
> Hi Eric,
>> Without this, recent test improvements were exposing failures
>> of gnulib's replacement on cygwin.
> Which failures were this? If I understand it correctly, a gnulib strerror_r
> replacement that does not use __xpg_strerror_r on Cygwin 1.7.9 should be
> identical to the one built on Cygwin <= 1.7.8. But a testdir created with
> $ ./gnulib-tool --create-testdir --dir=/tmp/testdir --with-tests strerror 
> perror
> and built on Cygwin 1.7.5 passes all tests.

Cygwin 1.7.8 tried (but failed) to introduce __xpg_strerror_r; it
actually got added in 1.7.9.  But in the process of adding
__xpg_sterror_r, the original strerror_r was fixed to align more closely
to glibc behavior.  Thus, it was changed so that strerror_r(EACCES, buf,
2) no longer overwrites buf with a (truncated) message to buf, so the
caller instead has to manually copy the static string result over to buf.

When testing at commit d118714, I got:

../../gltests/test-strerror_r.c:82: assertion failed
/bin/sh: line 5:  2060 Aborted                 (core dumped)
EXEEXT='.exe' srcdir='../../gltests' MAKE='make' ${dir}$tst
FAIL: test-strerror_r.exe

at that point, line 82 was:

82                  ASSERT ((strcmp (buf, "BADFACE") == 0) == (i == 0));

with i at 1.

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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