summaryrefslogtreecommitdiff
path: root/src/dir.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2019-09-07 16:59:46 -0400
committerPaul Smith <psmith@gnu.org>2019-09-07 20:12:44 -0400
commitc0cb9c8b3d0b163f845a867138379b0ef586a0c8 (patch)
treedffb12625d65c889527ff102337315edd6e3ebd2 /src/dir.c
parent34ee9adaed8e5dc094456a901386aee24ee114f3 (diff)
downloadmake-git-c0cb9c8b3d0b163f845a867138379b0ef586a0c8.tar.gz
* configure.ac: Check whether struct dirent has a d_type field
* src/dir.c (dir_contents_file_exists_p): Use the autoconf macro HAVE_STRUCT_DIRENT_D_TYPE rather than relying on the GNU libc- specific _DIRENT_HAVE_D_TYPE. * lib/glob.c: Set HAVE_D_TYPE if HAVE_STRUCT_DIRENT_D_TYPE.
Diffstat (limited to 'src/dir.c')
-rw-r--r--src/dir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dir.c b/src/dir.c
index efa35f68..b867f950 100644
--- a/src/dir.c
+++ b/src/dir.c
@@ -732,7 +732,7 @@ dir_contents_file_exists_p (struct directory_contents *dir,
#else
df->name = strcache_add_len (d->d_name, len);
#endif
-#ifdef _DIRENT_HAVE_D_TYPE
+#ifdef HAVE_STRUCT_DIRENT_D_TYPE
df->type = d->d_type;
#endif
df->length = len;
@@ -1245,7 +1245,7 @@ read_dirstream (__ptr_t stream)
#ifdef _DIRENT_HAVE_D_NAMLEN
d->d_namlen = len - 1;
#endif
-#ifdef _DIRENT_HAVE_D_TYPE
+#ifdef HAVE_STRUCT_DIRENT_D_TYPE
d->d_type = df->type;
#endif
memcpy (d->d_name, df->name, len);