gconf r2718 - in trunk: . backends gconf



Author: halfline
Date: Mon Dec  8 15:41:28 2008
New Revision: 2718
URL: http://svn.gnome.org/viewvc/gconf?rev=2718&view=rev

Log:
2008-12-08  Ray Strode  <rstrode redhat com>

	* gconf/gconfd.c: (logfile_save):
	Use fsync instead of fdatasync for portability
	(bug 563401).
	* backends/markup-tree.c (save_tree_with_locale):
	Also flush and sync here before closing (Patch
	from Richard Hult, bug 562976)


Modified:
   trunk/ChangeLog
   trunk/backends/markup-tree.c
   trunk/gconf/gconfd.c

Modified: trunk/backends/markup-tree.c
==============================================================================
--- trunk/backends/markup-tree.c	(original)
+++ trunk/backends/markup-tree.c	Mon Dec  8 15:41:28 2008
@@ -4386,6 +4386,7 @@
    */
   if (dir->entries == NULL && (!save_as_subtree || dir->subdirs == NULL))
     {
+      fsync (new_fd);
       close (new_fd);
       new_fd = -1;
       goto done_writing;
@@ -4466,6 +4467,13 @@
       goto done_writing;
     }
 
+  if (fflush (f) != 0 || fsync (fileno (f)) < 0)
+    {
+      gconf_log (GCL_WARNING,
+                 _("Could not flush file '%s' to disk: %s"),
+                 new_filename, g_strerror (errno));
+    }
+
   if (fclose (f) < 0)
     {
       f = NULL; /* f is still freed even if fclose fails according to the

Modified: trunk/gconf/gconfd.c
==============================================================================
--- trunk/gconf/gconfd.c	(original)
+++ trunk/gconf/gconfd.c	Mon Dec  8 15:41:28 2008
@@ -1639,7 +1639,7 @@
       goto out;
     }
 
-  if (fdatasync (fd) < 0)
+  if (fsync (fd) < 0)
     {
       gconf_log (GCL_WARNING,
                  _("Could not flush saved state file '%s' to disk: %s"),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]