From 5eb64025f92d9534609d82052e520c049ba0de62 Mon Sep 17 00:00:00 2001 From: Ari Lazier Date: Mon, 20 Jun 2016 10:49:53 -0700 Subject: [PATCH] remove management directories in node --- src/node/platform.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/node/platform.cpp b/src/node/platform.cpp index 6d355cc2..6a0820c3 100644 --- a/src/node/platform.cpp +++ b/src/node/platform.cpp @@ -66,7 +66,12 @@ void remove_realm_files_from_directory(const std::string &dir_path) while (struct dirent *entry = readdir(dir)) { if (strstr(entry->d_name, ".realm")) { // Intentionally not complaining if there was an error. - unlink(entry->d_name); + if (entry->d_type == DT_DIR) { + rmdir(entry->d_name); + } + else { + unlink(entry->d_name); + } } }