summaryrefslogtreecommitdiff
path: root/gl
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-08-29 10:05:24 +0200
committerSimon Josefsson <simon@josefsson.org>2008-08-29 10:05:24 +0200
commit55b3f4a91e16515ff617ad239dc7f5ad8a6a760b (patch)
tree146860e3c72567fe5a46c0e3c7561cbd63395ff8 /gl
parentb855779d46c07ae5a03280536e24f8405c374dcf (diff)
downloadgnutls-55b3f4a91e16515ff617ad239dc7f5ad8a6a760b.tar.gz
Update gnulib files.
Diffstat (limited to 'gl')
-rw-r--r--gl/getdelim.c15
-rw-r--r--gl/m4/getdelim.m41
2 files changed, 11 insertions, 5 deletions
diff --git a/gl/getdelim.c b/gl/getdelim.c
index 3c519ccbf4..49edf7725c 100644
--- a/gl/getdelim.c
+++ b/gl/getdelim.c
@@ -33,13 +33,18 @@
#ifndef SSIZE_MAX
# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
#endif
-#if !HAVE_FLOCKFILE
+
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+# define getc_maybe_unlocked(fp) getc(fp)
+#elif !HAVE_FLOCKFILE || !HAVE_FUNLOCKFILE || !HAVE_DECL_GETC_UNLOCKED
# undef flockfile
-# define flockfile(x) ((void) 0)
-#endif
-#if !HAVE_FUNLOCKFILE
# undef funlockfile
+# define flockfile(x) ((void) 0)
# define funlockfile(x) ((void) 0)
+# define getc_maybe_unlocked(fp) getc(fp)
+#else
+# define getc_maybe_unlocked(fp) getc_unlocked(fp)
#endif
/* Read up to (and including) a DELIMITER from FP into *LINEPTR (and
@@ -79,7 +84,7 @@ getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp)
{
int i;
- i = getc (fp);
+ i = getc_maybe_unlocked (fp);
if (i == EOF)
{
result = -1;
diff --git a/gl/m4/getdelim.m4 b/gl/m4/getdelim.m4
index 18b96bef85..7760f8279b 100644
--- a/gl/m4/getdelim.m4
+++ b/gl/m4/getdelim.m4
@@ -31,4 +31,5 @@ AC_DEFUN([gl_FUNC_GETDELIM],
AC_DEFUN([gl_PREREQ_GETDELIM],
[
AC_CHECK_FUNCS([flockfile funlockfile])
+ AC_CHECK_DECLS([getc_unlocked])
])