Bug 17352: synchronize the file before renaming
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 29 Aug 2008 14:13:15 +0000 (17:13 +0300)
committerColin Walters <walters@verbum.org>
Fri, 5 Sep 2008 01:51:52 +0000 (21:51 -0400)
commit9680c283586d7165e7482db8c3dcaf2d03e2f0b6
treedd0e3ca6b3043de368ae74a6a0f13e5d8bddb686
parent1859c66351285de313d1ccd2540e9d71aaf768a3
Bug 17352: synchronize the file before renaming

Dbus is doing atomic file updates by copying them, changing
the copy, and re-naming them. However, it does not synchronize
the file before re-naming, which results in corruption in
case of unclean reboots. The reason for this is that file-systems
have write-back cache and they postpone writing data to the media.

This patch adds the missed fsync() for the Unix part. I do
not have windows so cannot provide a windows port fix.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Colin Walters <walters@verbum.org>
dbus/dbus-sysdeps-unix.c