summaryrefslogtreecommitdiff
path: root/src/remove.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/remove.c')
-rw-r--r--src/remove.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/remove.c b/src/remove.c
index a0ad0a124..21c5ac0ac 100644
--- a/src/remove.c
+++ b/src/remove.c
@@ -527,8 +527,9 @@ is_empty_dir (char const *dir)
dp = readdir (dirp);
if (dp == NULL)
{
+ int saved_errno = errno;
closedir (dirp);
- return errno == 0 ? true : false;
+ return saved_errno == 0 ? true : false;
}
f = dp->d_name;