From 193ada771893e1d794f30869a1ed6dd1c1d3f14d Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Thu, 28 Nov 2019 22:21:19 +0100 Subject: [PATCH] Sync the base configuration directory after each subdirectory rename operation. This ensures the proper ordering of the renames in the event of a crash. --- src/conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf.c b/src/conf.c index 9cf76fbe..9527c1ed 100644 --- a/src/conf.c +++ b/src/conf.c @@ -397,7 +397,7 @@ bool config_rename(meshlink_handle_t *mesh, const char *old_conf_subdir, const c snprintf(old_path, sizeof(old_path), "%s" SLASH "%s", mesh->confbase, old_conf_subdir); snprintf(new_path, sizeof(new_path), "%s" SLASH "%s", mesh->confbase, new_conf_subdir); - return rename(old_path, new_path) == 0; + return rename(old_path, new_path) == 0 && sync_path(mesh->confbase); } bool config_sync(meshlink_handle_t *mesh, const char *conf_subdir) { -- 2.39.2