summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2013-08-21 16:10:18 -0600
committerEric Blake <eblake@redhat.com>2013-08-21 16:16:27 -0600
commit9a52d861868c8d787c66b75753a747e5c1ebedc6 (patch)
treeab1cb97b32a239fea453bd748eaeb392693ae3f8 /m4
parent7c121ba6ebe82ea54dda3ce787f491a85ec1d1d9 (diff)
downloadgnulib-9a52d861868c8d787c66b75753a747e5c1ebedc6.tar.gz
d-ino: avoid false negative on symlink
If the first entry listed in a directory is a symlink, we had a spurious mismatch between d_ino (which should match the symlink) and stat() results (which chases the symlink). Reported by Stephane Chazelas <stephane.chazelas@gmail.com>. * m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): Use lstat. Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'm4')
-rw-r--r--m4/d-ino.m44
1 files changed, 2 insertions, 2 deletions
diff --git a/m4/d-ino.m4 b/m4/d-ino.m4
index aab82c2dfd..d093b3ff12 100644
--- a/m4/d-ino.m4
+++ b/m4/d-ino.m4
@@ -1,4 +1,4 @@
-# serial 13
+# serial 14
dnl From Jim Meyering.
dnl
@@ -30,7 +30,7 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO],
e = readdir (dp);
if (! e)
return 2;
- if (stat (e->d_name, &st) != 0)
+ if (lstat (e->d_name, &st) != 0)
return 3;
if (e->d_ino != st.st_ino)
return 4;