]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(remove_cwd_entries): Use CLOSEDIR, not closedir.
authorJim Meyering <jim@meyering.net>
Wed, 28 Aug 2002 06:52:07 +0000 (06:52 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 28 Aug 2002 06:52:07 +0000 (06:52 +0000)
Give a diagnostic and fail if closedir fails.

src/remove.c

index 59368ac09abad70048256d43439cc92dd372134b..f09184e35c2a3c7ca6e9f8850e08f97776f57efb 100644 (file)
@@ -871,7 +871,11 @@ remove_cwd_entries (char **subdir, struct stat *subdir_sb,
        break;
     }
 
-  closedir (dirp);
+  if (CLOSEDIR (dirp) != 0)
+    {
+      error (0, errno, _("reading directory %s"), quote (full_filename (".")));
+      status = RM_ERROR;
+    }
 
   return status;
 }