summaryrefslogtreecommitdiff
path: root/gl/lib/readdir.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2023-09-23 22:17:23 +0100
committerColin Watson <cjwatson@debian.org>2023-09-23 22:17:23 +0100
commitc0cbb6e4f5cb2a778be6aa75daabbe8cf41686a8 (patch)
treecf06f6e7ea318fd4c5c4904bd1eb8f86cebcb747 /gl/lib/readdir.c
parent0b7139d556a20a51aab0e70ae508eab3f3532473 (diff)
parent10ffa2be71a9ba46c4328b3792a2001f4092625d (diff)
New upstream release (2.12.0)
Diffstat (limited to 'gl/lib/readdir.c')
-rw-r--r--gl/lib/readdir.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gl/lib/readdir.c b/gl/lib/readdir.c
index 8e841df8..04dbba21 100644
--- a/gl/lib/readdir.c
+++ b/gl/lib/readdir.c
@@ -1,5 +1,5 @@
/* Read the next entry of a directory.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -22,7 +22,9 @@
#include <errno.h>
#include <stddef.h>
-#include "dirent-private.h"
+#if GNULIB_defined_DIR
+# include "dirent-private.h"
+#endif
/* Don't assume that UNICODE is not defined. */
#undef FindNextFile
@@ -30,7 +32,11 @@
struct dirent *
readdir (DIR *dirp)
+#undef readdir
{
+#if HAVE_DIRENT_H /* equivalent to HAVE_READDIR */
+ return readdir (dirp->real_dirp);
+#else
char type;
struct dirent *result;
@@ -99,4 +105,5 @@ readdir (DIR *dirp)
result->d_type = type;
return result;
+#endif
}