On Solaris, a non-zero return was also reflected into errno.
Leaving errno unchanged is a useful feature worth guaranteeing.
* m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Check for Solaris behavior.
* doc/posix-functions/strerror_r.texi (strerror_r): Document it.
Signed-off-by: Eric Blake
---
This f
A couple of copy-and-paste issues led to a compiler warning
during configure, detected on at least Solaris.
* m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Don't return a char*.
Signed-off-by: Eric Blake
---
ChangeLog|5 -
m4/strerror_r.m4 |5 ++---
2 files changed, 6 insertions(+)
On 05/20/2011 05:21 PM, Eric Blake wrote:
> But both errors are allowed by POSIX, and we have the case that glibc's
> __xpg_strerror_r favors EINVAL while cygwin's _xpg_strerror_r favors
> ERANGE. The testsuite tests for both codes, because there is no
> heirarchy in POSIX on which error code if m
On 05/20/2011 04:50 PM, Bruno Haible wrote:
> Hi Eric,
>
>> @@ -95,6 +95,15 @@ int
>> strerror_r (int errnum, char *buf, size_t buflen)
>> #undef strerror_r
>> {
>> + /* Filter this out now, so that rest of this replacement knows that
>> + there is room for a non-empty message and trailing
* lib/strerror_r.c (safe_copy): New helper method.
(strerror_r): Guarantee a non-empty string.
* tests/test-strerror_r.c (main): Enhance tests to incorporate
recent POSIX rulings and to match our strerror guarantees.
* doc/posix-functions/strerror_r.texi (strerror_r): Document this.
---
This now p
Hi Eric,
> @@ -95,6 +95,15 @@ int
> strerror_r (int errnum, char *buf, size_t buflen)
> #undef strerror_r
> {
> + /* Filter this out now, so that rest of this replacement knows that
> + there is room for a non-empty message and trailing NUL. */
> + if (buflen <= 1)
> +{
> + if (
On 20 May 2011 23:02, Eric Blake wrote:
>
> nul does not work anywhere besides Windows; elsewhere it is spelled
> /dev/null.
That's what I thought, but I couldn't find a file called "nul" created
anywhere. However, I have now found it. D'oh.
--
http://rrt.sc3d.org
On 05/20/2011 03:32 PM, Reuben Thomas wrote:
> I've just been playing with flymake. To make it work at all I copied
> the following rule into my src/Makefile.am from the flymake manual:
>
> check-syntax:
> gcc -o nul -S ${CHK_SOURCES}
>
> Secondly, the -o nul option to gcc seems to be an
>
I've just been playing with flymake. To make it work at all I copied
the following rule into my src/Makefile.am from the flymake manual:
check-syntax:
gcc -o nul -S ${CHK_SOURCES}
It would be nice to put this in maint.mk, but then it wouldn't be
picked up by make in src/, only at the top-
* lib/strerror_r.c (strerror_r): Filter out buflen of 1 up front.
Signed-off-by: Eric Blake
---
ChangeLog|3 +++
lib/strerror_r.c | 30 +-
2 files changed, 12 insertions(+), 21 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 598238f..bda43a6 1006
The one I have in mind is libgc. It seems that
-DREDIRECT_MALLOC=GC_malloc -DIGNORE_FREE
is my only option right now; maybe it is also sufficient (since if I
wanted to use libgc's own API, then I obviously wouldn't be using
gnulib's APIs anyway)?
--
http://rrt.sc3d.org
On 05/20/2011 12:42 PM, Bruno Haible wrote:
> Hi Eric,
>
>> This change means that now strerror depends on strerror_r-posix, and
>> strerror_r-posix depends on strerror. Is that circular dependency okay
>> for gnulib-tool?
>
> Yes, gnulib-tool supports circular dependencies, even with
> --condit
Hi Eric,
> This change means that now strerror depends on strerror_r-posix, and
> strerror_r-posix depends on strerror. Is that circular dependency okay
> for gnulib-tool?
Yes, gnulib-tool supports circular dependencies, even with
--conditional-dependencies.
But the circular dependency was not
> With just the first 2 out of 3 commits (partial revert and work around IRIX
> 6.5
> cc bug), IRIX 6.5 cc would still have complained ("The indicated constant
> value
> is not known.") about a combination of signed and unsigned integers, this time
> with '|', not '+' ... and HP-UX cc would still
On 05/18/2011 09:27 PM, Bruno Haible wrote:
>> 1) The strerror_r replacement, when EXTEND_STRERROR_R is defined,
>> clobbers the strerror function's buffer, which it shouldn't.
>
> Here comes the fix for 1). Tested on
>
> --- modules/strerror Thu May 19 04:13:54 2011
> ***
> *
This uncovered a glibc bug, although not many people check for
perror failures, so for now I'm not working around it.
http://sourceware.org/bugzilla/show_bug.cgi?id=12792
* tests/macros.h (STREQ) Add macro.
* modules/perror-tests (Files): Add second test.
* tests/test-perror2.c (main): New file.
*
POSIX requires that 'errno = 0; perror ("")' print the same message
as strerror(0), but this failed if we were replacing strerror to work
around the FreeBSD bug of treating 0 as a failure.
* m4/perror.m4 (gl_FUNC_PERROR): Also replace perror if strerror_r
is broken. Move AC_LIBOBJ...
* modules/pe
Make the test simpler, and also check for correct exit status.
* modules/perror-tests (Files): Add init.sh.
* tests/test-perror.sh: Use temporary directory.
Signed-off-by: Eric Blake
---
General cleanup. I thought about enhancing this test further, but
then decided to go with a new test when I
Hello Jan,
On Fri 20 May 2011 15:56, Jan Nieuwenhuizen writes:
> Andy Wingo writes:
>
>> I read the thread and it looked like this patch was close to being
>> accepted
>
> Yes, it looks like that.
Heh ;)
> My first simplistic patch to just make guile canonicalize_file_name work
> on mingw took
On 05/19/2011 08:06 PM, Bruno Haible wrote:
> Eric Blake wrote:
>> More accurately:
>>
>> The change in strerror_r behavior was in 1.7.8 (which also tried to
>> introduce __xpg_strerror_r), but a bug in the headers vs. export table
>> ended up with a link failure for __xpg_strerror_r:
>> http://cyg
Hi Paul,
> Here's what I committed:
With these patches, the test compiles and passes now also on HP-UX 11.23 with
cc and IRIX 6.5 with cc.
With just the first 2 out of 3 commits (partial revert and work around IRIX 6.5
cc bug), IRIX 6.5 cc would still have complained ("The indicated constant val
FYI, these fix quite a few typos:
>From c9ff025783e5374226ffbf7940f40ce7db6852ed Mon Sep 17 00:00:00 2001
From: Jim Meyering
Date: Thu, 19 May 2011 22:18:05 +0200
Subject: [PATCH 1/2] maint: correct misuse of "a" and "an"
* doc/regex.texi (Collating Symbol Operators): s/an close.../a close/
* li
22 matches
Mail list logo