From c59a8e2d32e25ab8807335dbb2d34f19b23e2825 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 21 Jan 2003 18:49:49 +0000 Subject: [PATCH] (remove_entry) [ROOT_CAN_UNLINK_DIRS && HAVE_STRUCT_DIRENT_D_TYPE]: If a file has d_type == DT_UNKNOWN it may still be a directory -- or not (e.g., with FreeBSD on an NFS-mounted file system), so resort to calling lstat to find out. --- src/remove.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/remove.c b/src/remove.c index 95e331a843..e9223fd537 100644 --- a/src/remove.c +++ b/src/remove.c @@ -695,7 +695,7 @@ remove_entry (Dirstack_state const *ds, char const *filename, if (is_dir == T_UNKNOWN) { # if HAVE_STRUCT_DIRENT_D_TYPE - if (dp) + if (dp && dp->d_type != DT_UNKNOWN) is_dir = DT_IS_DIR (dp) ? T_YES : T_NO; else # endif -- 2.47.2