summaryrefslogtreecommitdiff
path: root/gl/getdelim.c
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/getdelim.c
parentb855779d46c07ae5a03280536e24f8405c374dcf (diff)
downloadgnutls-55b3f4a91e16515ff617ad239dc7f5ad8a6a760b.tar.gz
Update gnulib files.
Diffstat (limited to 'gl/getdelim.c')
-rw-r--r--gl/getdelim.c15
1 files changed, 10 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;