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) {
return false;
}
- if(mesh->loop.now.tv_sec >= st.st_mtime + mesh->invitation_timeout) {
+ if(time(NULL) >= st.st_mtime + mesh->invitation_timeout) {
logger(mesh, MESHLINK_ERROR, "Peer tried to use an outdated invitation file %s\n", name);
fclose(f);
unlink(used_path);