summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjkoan <jkoan@gmx.de>2019-05-25 11:21:41 +0200
committerjkoan <jkoan@users.noreply.github.com>2019-06-14 07:35:02 +0200
commit8ca3331c469c3724a558b6829c31cd2b9822cc93 (patch)
tree98e9fefc3a0b38efa5b1d694b0027d834a4796f8
parent3ecdd133c43ceb23d16b3be5e3c5ca9b42606ae1 (diff)
downloadnavit-8ca3331c469c3724a558b6829c31cd2b9822cc93.tar.gz
Fix:bookmarks:Ensure that bookmarks are synced to disk
-rw-r--r--navit/bookmarks.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/navit/bookmarks.c b/navit/bookmarks.c
index a3e5c482d..54be384b7 100644
--- a/navit/bookmarks.c
+++ b/navit/bookmarks.c
@@ -362,6 +362,10 @@ static int bookmarks_store_bookmarks_to_file(struct bookmarks *this_, int limit
this_->bookmarks_list=g_list_next(this_->bookmarks_list);
}
+#ifdef FlushFileBuffers
+ FlushFileBuffers(f)
+#endif FlushFileBuffers
+
fclose(f);
g_hash_table_destroy(dedup);
@@ -372,6 +376,9 @@ static int bookmarks_store_bookmarks_to_file(struct bookmarks *this_, int limit
}
unlink(this_->bookmark_file);
+#ifdef _POSIX
+ sync();
+#endif _POSIX
result=(rename(this_->working_file,this_->bookmark_file)==0);
if (!result) {
navit_add_message(this_->parent->u.navit,_("Failed to write bookmarks file"));