If we ever adjust strerror-override.h to have a larger size for
STACKBUF_LEN, then perror should also pick up the adjustment.
* modules/perror (Depends-on): Add strerror-override.
* lib/perror.c (perror): Use it to avoid magic number.
Signed-off-by: Eric Blake <eblake@redhat.com>
2011-06-21 Eric Blake <eblake@redhat.com>
+ perror: adjust array size
+ * modules/perror (Depends-on): Add strerror-override.
+ * lib/perror.c (perror): Use it to avoid magic number.
+
strerror-override: reduce size
* lib/strerror-override.c (strerror_override): Use fewer lines.
#include <stdlib.h>
#include <string.h>
+#include "strerror-override.h"
+
/* Use the system functions, not the gnulib overrides in this file. */
#undef fprintf
void
perror (const char *string)
{
- char stackbuf[256];
+ char stackbuf[STACKBUF_LEN];
int ret;
/* Our implementation guarantees that this will be a non-empty
Depends-on:
stdio
errno [test $REPLACE_PERROR = 1]
+strerror-override [test $REPLACE_PERROR = 1]
strerror_r-posix [test $REPLACE_PERROR = 1]
configure.ac: