mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] environment: Do not remove base env directory
@ 2015-02-19 21:16 Sascha Hauer
  0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2015-02-19 21:16 UTC (permalink / raw)
  To: Barebox List

When removing empty directories do not remove the base
directory.

Signed-off-by: Sascha Hauer <s.hauer@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


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-19 21:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-19 21:16 [PATCH] environment: Do not remove base env directory Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox