From: Guus Sliepen Date: Thu, 28 Nov 2019 21:21:19 +0000 (+0100) Subject: Sync the base configuration directory after each subdirectory rename operation. X-Git-Url: http://git.meshlink.io/?p=meshlink;a=commitdiff_plain;h=193ada771893e1d794f30869a1ed6dd1c1d3f14d Sync the base configuration directory after each subdirectory rename operation. This ensures the proper ordering of the renames in the event of a crash. --- 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) {