summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-02-19 22:15:15 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-02-19 22:15:18 +0100
commit61fc21c197d12ab152243d19c7a8809883c7fd1e (patch)
treef50da39b37c7f953f7c56ca8fb7e052e3f8a93ec
parentd7dc46d5d6f2c80d1719ef877df728457790ac45 (diff)
downloadbarebox-61fc21c197d12ab152243d19c7a8809883c7fd1e.tar.gz
barebox-61fc21c197d12ab152243d19c7a8809883c7fd1e.tar.xz
environment: Do not remove base env directory
When removing empty directories do not remove the base directory. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--common/environment.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/environment.c b/common/environment.c
index 2639411e26..7e176b3a7e 100644
--- a/common/environment.c
+++ b/common/environment.c
@@ -230,6 +230,9 @@ static int file_remove_action(const char *filename, struct stat *statbuf,
static int dir_remove_action(const char *filename, struct stat *statbuf,
void *userdata, int depth)
{
+ if (!depth)
+ return 1;
+
rmdir(filename);
return 1;