diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/remove.c | 10 |
2 files changed, 7 insertions, 5 deletions
@@ -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> diff --git a/src/remove.c b/src/remove.c index 1b4c4c4f8..ce9b3ddf2 100644 --- a/src/remove.c +++ b/src/remove.c @@ -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; } |