File gconf2-fdatasync.patch of Package gconf2 (Revision 1296f7f1f850e2027408561d01081013)
Currently displaying revision 1296f7f1f850e2027408561d01081013 , Show latest
xxxxxxxxxx
1
diff -ur *6.orig/backends/markup-tree.c GConf-3.2.6/backends/markup-tree.c
2
--- *6.orig/backends/markup-tree.c 2011-08-15 21:59:31.000000000 -0500
3
+++ GConf-3.2.6/backends/markup-tree.c 2015-01-02 16:04:16.479034791 -0600
4
5
return dir->is_dir_empty;
6
}
7
8
+static gboolean
9
+install_in_progress ()
10
+{
11
+ return (g_strcmp0 (getenv ("YAST_IS_RUNNING"), "instsys") == 0);
12
+}
13
+
14
static void
15
save_tree_with_locale (MarkupDir *dir,
16
gboolean save_as_subtree,
17
18
*/
19
if (dir->entries == NULL && (!save_as_subtree || dir->subdirs == NULL))
20
{
21
- fsync (new_fd);
22
+ if (!install_in_progress ())
23
+ fdatasync (new_fd);
24
close (new_fd);
25
new_fd = -1;
26
goto done_writing;
27
28
goto done_writing;
29
}
30
31
- if (fflush (f) != 0 || fsync (fileno (f)) < 0)
32
+ if (fflush (f) != 0 || (!install_in_progress () && fdatasync (fileno (f)) < 0))
33
{
34
gconf_log (GCL_WARNING,
35
_("Could not flush file '%s' to disk: %s"),
36
diff -ur *6.orig/backends/xml-dir.c GConf-3.2.6/backends/xml-dir.c
37
--- *6.orig/backends/xml-dir.c 2011-08-15 21:59:31.000000000 -0500
38
+++ GConf-3.2.6/backends/xml-dir.c 2015-01-02 16:04:16.480034791 -0600
39
40
41
#ifdef HAVE_FSYNC
42
/* sync kernel-space buffers to disk */
43
- if (fsync (fd) == -1)
44
+ if (g_strcmp0 (getenv ("YAST_IS_RUNNING"), "instsys") && fdatasync (fd) == -1)
45
return -1;
46
#endif
47
48
diff -ur *6.orig/gconf/gconfd.c GConf-3.2.6/gconf/gconfd.c
49
--- *6.orig/gconf/gconfd.c 2012-04-25 20:12:49.000000000 -0500
50
+++ GConf-3.2.6/gconf/gconfd.c 2015-01-02 16:04:16.481034791 -0600
51
52
goto out;
53
}
54
55
- if (fsync (fd) < 0)
56
+ if (g_strcmp0 (getenv ("YAST_IS_RUNNING"), "instsys") && fdatasync (fd) < 0)
57
{
58
gconf_log (GCL_WARNING,
59
_("Could not flush saved state file '%s' to disk: %s"),
60