From d2846b805abfbe143ea0d128e6d3d28298af8300 Mon Sep 17 00:00:00 2001 From: Wang He Date: Sun, 2 Oct 2016 11:07:48 +0200 Subject: [PATCH] Fix issue #42: Skip base directories in bootclean. Signed-off-by: Wang He Signed-off-by: Joachim Nilsson --- finit.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/finit.c b/finit.c index 9a0c74bc..934d8549 100644 --- a/finit.c +++ b/finit.c @@ -118,9 +118,11 @@ static int fsck(int pass) return 0; } -static int do_clean(const char *fpath, const struct stat *UNUSED(sb), int UNUSED(tflag), struct FTW *UNUSED(ftwbuf)) +static int do_clean(const char *fpath, const struct stat *UNUSED(sb), int UNUSED(tflag), struct FTW *ftwbuf) { - _d("Removing %s", fpath); + if (ftwbuf->level == 0) + return 1; + remove(fpath); return 0;