summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/remove.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/remove.c b/src/remove.c
index 3dc692947..f6d3f0c67 100644
--- a/src/remove.c
+++ b/src/remove.c
@@ -1016,8 +1016,7 @@ remove_entry (int fd_cwd, Dirstack_state const *ds, char const *filename,
errno = EISDIR;
if (! x->recursive
- || errno == ENOENT || errno == ENOTDIR
- || errno == ELOOP || errno == ENAMETOOLONG)
+ || (cache_stat_ok (st) && !S_ISDIR (st->st_mode)))
{
if (ignorable_missing (x, errno))
return RM_OK;
@@ -1028,6 +1027,7 @@ remove_entry (int fd_cwd, Dirstack_state const *ds, char const *filename,
quote (full_filename (filename)));
return RM_ERROR;
}
+ assert (!cache_stat_ok (st) || S_ISDIR (st->st_mode));
}
else
{