Jim Meyering wrote:
> In case anyone wants to try it, here's the same patch
> rebased against master, and with amended log entry:
>
>>From f8a861ccf70a88d09102154ae77da6c1d9db1ad0 Mon Sep 17 00:00:00 2001
> From: Jim Meyering <[email protected]>
> Date: Sun, 12 Jul 2009 18:15:23 +0200
> Subject: [PATCH 1/2] rm: rewrite to use fts
>
> * remove.c: Don't include "unlinkdir.h"; no longer used.
> Do not include <setjmp.h> or "cycle-check.h".  Likewise.

I've just amended it with this change, so as not to provoke
the wrath of the warn_unused_result gods:

diff --git a/src/remove.c b/src/remove.c
index d15fe57..32f67a1 100644
--- a/src/remove.c
+++ b/src/remove.c
@@ -612,10 +612,11 @@ rm (char *const *file, struct rm_options const *x)
           UPDATE_STATUS (rm_status, s);
         }

-      /* Ignore failure, since the only way it can do so is in failing to
-         return to the original directory, and since we're about to exit,
-         that doesn't matter.  */
-      fts_close (fts);
+      if (fts_close (fts) != 0)
+        {
+          error (0, errno, _("fts_close failed"));
+          rm_status = RM_ERROR;
+        }
     }

   return rm_status;


Reply via email to