* src/remove.c (cache_stat_init): Return its argument, for convenience.
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 25 Nov 2006 09:59:22 +0000 (10:59 +0100)
committerJim Meyering <jim@meyering.net>
Sun, 26 Nov 2006 16:39:27 +0000 (17:39 +0100)
Update the caller in remove_dir.

Signed-off-by: Paul Eggert <eggert@cs.ucla.edu>
ChangeLog
src/remove.c

index cca0cf3..b005871 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
 
        * src/remove.c (rm_1): Remove decl of local, fd_cwd.
        Replace each of two uses with literal AT_FDCWD.
+       (cache_stat_init): Return its argument, for convenience.
+       Update the caller in remove_dir.
 
 2006-11-25  Jim Meyering  <jim@meyering.net>
 
index 1b4c4c4..ce9b3dd 100644 (file)
@@ -173,11 +173,12 @@ cache_fstatat (int fd, char const *file, struct stat *st, int flag)
   return -1;
 }
 
-/* Initialize a fstatat cache *ST.  */
-static inline void
+/* Initialize a fstatat cache *ST.  Return ST for convenience.  */
+static inline struct stat *
 cache_stat_init (struct stat *st)
 {
   st->st_size = -1;
+  return st;
 }
 
 /* Return true if *ST has been statted.  */
@@ -1403,8 +1404,8 @@ remove_dir (int fd_cwd, Dirstack_state *ds, char const *dir,
               But that's no big deal since we're interactive.  */
            struct stat empty_st;
            Ternary is_empty;
-           cache_stat_init (&empty_st);
-           enum RM_status s = prompt (fd, ds, empty_dir, &empty_st, x,
+           enum RM_status s = prompt (fd, ds, empty_dir,
+                                      cache_stat_init (&empty_st), x,
                                       PA_REMOVE_DIR, &is_empty);
 
            if (s != RM_OK)
@@ -1505,7 +1506,6 @@ rm_1 (Dirstack_state *ds, char const *filename,
     }
 
   ds_clear (ds);
-
   return status;
 }