From 37724f5e203c0aa40bb0d197c55aac87a1a272c1 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Fri, 8 Sep 2006 16:45:41 +0000 Subject: [PATCH] (try_purge_directory): Initialize struct st. Fix condition for selecting candidates for removal. --- src/incremen.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/incremen.c b/src/incremen.c index 7f04f80..6cd8efb 100644 --- a/src/incremen.c +++ b/src/incremen.c @@ -1381,22 +1381,23 @@ try_purge_directory (char const *directory_name) free (p); p = new_name (directory_name, cur); - if (!(entry = dumpdir_locate (current_stat_info.dumpdir, cur)) - || (*entry == 'D' && S_ISDIR (st.st_mode)) - || (*entry == 'Y' && !S_ISDIR (st.st_mode))) + if (deref_stat (false, p, &st)) { - if (deref_stat (false, p, &st)) + if (errno != ENOENT) /* FIXME: Maybe keep a list of renamed + dirs and check it here? */ { - if (errno != ENOENT) /* FIXME: Maybe keep a list of renamed - dirs and check it here? */ - { - stat_diag (p); - WARN ((0, 0, _("%s: Not purging directory: unable to stat"), - quotearg_colon (p))); - } - continue; + stat_diag (p); + WARN ((0, 0, _("%s: Not purging directory: unable to stat"), + quotearg_colon (p))); } - else if (one_file_system_option && st.st_dev != root_device) + continue; + } + + if (!(entry = dumpdir_locate (current_stat_info.dumpdir, cur)) + || (*entry == 'D' && !S_ISDIR (st.st_mode)) + || (*entry == 'Y' && S_ISDIR (st.st_mode))) + { + if (one_file_system_option && st.st_dev != root_device) { WARN ((0, 0, _("%s: directory is on a different device: not purging"), -- 2.44.0