From 2940b05fe985ba5cc0da1ee2337d737689d1d99e Mon Sep 17 00:00:00 2001 From: Pierre Grandin Date: Tue, 10 Apr 2018 21:43:24 -0700 Subject: Fix:bookmarks:Ensure that bookmarks are synced to disk --- navit/bookmarks.c | 30 ++++++++++++----------- navit/support/espeak/espeak-data/voices/asia/hy | 0 navit/support/espeak/espeak-data/voices/europe/ca | 0 navit/support/espeak/espeak-data/voices/europe/sq | 0 navit/support/espeak/espeak-data/voices/europe/sr | 0 navit/support/espeak/espeak-data/voices/other/la | 0 6 files changed, 16 insertions(+), 14 deletions(-) mode change 100755 => 100644 navit/support/espeak/espeak-data/voices/asia/hy mode change 100755 => 100644 navit/support/espeak/espeak-data/voices/europe/ca mode change 100755 => 100644 navit/support/espeak/espeak-data/voices/europe/sq mode change 100755 => 100644 navit/support/espeak/espeak-data/voices/europe/sr mode change 100755 => 100644 navit/support/espeak/espeak-data/voices/other/la diff --git a/navit/bookmarks.c b/navit/bookmarks.c index a3e5c482d..818f25ce1 100644 --- a/navit/bookmarks.c +++ b/navit/bookmarks.c @@ -1,6 +1,6 @@ /** * Navit, a modular navigation system. - * Copyright (C) 2005-2010 Navit Team + * Copyright (C) 2005-2018 Navit Team * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -364,19 +364,21 @@ static int bookmarks_store_bookmarks_to_file(struct bookmarks *this_, int limit fclose(f); - g_hash_table_destroy(dedup); - - if (this_->mr) { - map_rect_destroy(this_->mr); - this_->mr = 0; - } - - unlink(this_->bookmark_file); - result=(rename(this_->working_file,this_->bookmark_file)==0); - if (!result) { - navit_add_message(this_->parent->u.navit,_("Failed to write bookmarks file")); - } - return result; + g_hash_table_destroy(dedup); + + if (this_->mr) { + map_rect_destroy(this_->mr); + this_->mr = 0; + } + + unlink(this_->bookmark_file); + sync(); + result=(rename(this_->working_file,this_->bookmark_file)==0); + if (!result) + { + navit_add_message(this_->parent->u.navit,_("Failed to write bookmarks file")); + } + return result; } /** diff --git a/navit/support/espeak/espeak-data/voices/asia/hy b/navit/support/espeak/espeak-data/voices/asia/hy old mode 100755 new mode 100644 diff --git a/navit/support/espeak/espeak-data/voices/europe/ca b/navit/support/espeak/espeak-data/voices/europe/ca old mode 100755 new mode 100644 diff --git a/navit/support/espeak/espeak-data/voices/europe/sq b/navit/support/espeak/espeak-data/voices/europe/sq old mode 100755 new mode 100644 diff --git a/navit/support/espeak/espeak-data/voices/europe/sr b/navit/support/espeak/espeak-data/voices/europe/sr old mode 100755 new mode 100644 diff --git a/navit/support/espeak/espeak-data/voices/other/la b/navit/support/espeak/espeak-data/voices/other/la old mode 100755 new mode 100644 -- cgit v1.2.1