summaryrefslogtreecommitdiff
path: root/src/remove.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-11-25 10:59:22 +0100
committerJim Meyering <jim@meyering.net>2006-11-26 17:39:27 +0100
commit6b7c67ad88613f80028ac875ca052eb0a2af9c46 (patch)
tree093f2b3a074381a8ce318dc312b598fbbc034cd6 /src/remove.c
parent02e24f25939824e5292549c7d90e018e6efad01f (diff)
downloadcoreutils-6b7c67ad88613f80028ac875ca052eb0a2af9c46.tar.xz
* src/remove.c (cache_stat_init): Return its argument, for convenience.
Update the caller in remove_dir. Signed-off-by: Paul Eggert <eggert@cs.ucla.edu>
Diffstat (limited to 'src/remove.c')
-rw-r--r--src/remove.c10
1 files changed, 5 insertions, 5 deletions
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;
}