[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] perror: call strerror_r directly
From: |
Bruno Haible |
Subject: |
Re: [PATCH 1/2] perror: call strerror_r directly |
Date: |
Sat, 4 Jun 2011 12:55:30 +0200 |
User-agent: |
KMail/1.9.9 |
Hi Eric,
> > No need to make a wrapper that burns static storage when we can
> > just use stack storage.
> >
> > * modules/perror (Files): Drop strerror-impl.h.
> > * lib/perror.c (perror): Use our own stack buffer, rather than
> > calling a wrapper that uses static storage.
> > * doc/posix-functions/perror.texi (perror): Document a limitation
> > of our replacement.
>
> No comments, so I've pushed this.
If I didn't have time to review this patch, someone else ought to review it
instead of me.
This patch breaks compilation of module 'perror':
perror.c:38:27: strerror-impl.h: No such file or directory
*** Error code 1
I'm fixing it like this:
2011-06-04 Bruno Haible <address@hidden>
perror: Fix compilation error.
* lib/perror.c: Don't include intprops.h, verify.h, strerror-impl.h.
Undefine fprintf, not sprintf.
* modules/perror (Depends-on): Remove intprops, verify.
--- lib/perror.c.orig Sat Jun 4 12:51:16 2011
+++ lib/perror.c Sat Jun 4 12:47:18 2011
@@ -24,18 +24,8 @@
#include <stdlib.h>
#include <string.h>
-#include "intprops.h"
-#include "verify.h"
-
/* Use the system functions, not the gnulib overrides in this file. */
-#undef sprintf
-
-/* my_strerror (errnum) is equivalent to strerror (errnum).
- But it uses its own buffer, not the one from strerror(). */
-#define STATIC static
-#undef strerror
-#define strerror my_strerror
-#include "strerror-impl.h"
+#undef fprintf
void
perror (const char *string)
--- modules/perror.orig Sat Jun 4 12:51:16 2011
+++ modules/perror Sat Jun 4 12:51:09 2011
@@ -8,8 +8,6 @@
Depends-on:
stdio
errno [test $REPLACE_PERROR = 1]
-intprops [test $REPLACE_PERROR = 1]
-verify [test $REPLACE_PERROR = 1]
strerror_r-posix [test $REPLACE_PERROR = 1]
configure.ac:
--
In memoriam Mordechai Gebirtig <http://en.wikipedia.org/wiki/Mordechai_Gebirtig>