[PATCH] environment: Do not remove base env directory

Sascha Hauer s.hauer at pengutronix.de
Thu Feb 19 13:16:41 PST 2015


When removing empty directories do not remove the base
directory.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/environment.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/common/environment.c b/common/environment.c
index 2639411..7e176b3 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;
-- 
2.1.4




More information about the barebox mailing list