[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Remove dependency of getdelim on realloc-posix
From: |
Gavin Smith |
Subject: |
Remove dependency of getdelim on realloc-posix |
Date: |
Sat, 13 Aug 2016 14:55:48 +0100 |
This patch is intended to remove a warning due to redefining realloc
twice when building Perl extension modules, once by gnulib, a second
time by Perl's headers. Reported here
http://lists.gnu.org/archive/html/bug-texinfo/2016-08/msg00021.html
diff --git a/ChangeLog b/ChangeLog
index 2414e8e..9033e14 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-08-13 Gavin Smith <address@hidden>
+
+ * modules/getdelim: Remove dependency on realloc-posix.
+ * lib/getdelim.c (getdelim): Set errno to ENOENT if realloc failed,
+ as is done in lib/canonicalize-lgpl.c (__realpath).
+
2016-07-15 Paul Eggert <address@hidden>
obstack: pacify GCC 6 with -Wnull-dereference
diff --git a/lib/getdelim.c b/lib/getdelim.c
index 68a6f34..8d2dbbe 100644
--- a/lib/getdelim.c
+++ b/lib/getdelim.c
@@ -75,6 +75,9 @@ getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp)
if (new_lineptr == NULL)
{
result = -1;
+ /* It's easier to set errno to ENOMEM than to rely on the
+ 'realloc-posix' gnulib module. */
+ errno = ENOMEM;
goto unlock_return;
}
*lineptr = new_lineptr;
diff --git a/modules/getdelim b/modules/getdelim
index e84558c..ee71165 100644
--- a/modules/getdelim
+++ b/modules/getdelim
@@ -9,7 +9,6 @@ Depends-on:
stdio
extensions
stdint [test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1]
-realloc-posix [test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1]
errno [test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1]
configure.ac:
- Remove dependency of getdelim on realloc-posix,
Gavin Smith <=