ensure sources.yaml gets flushed to disk
authorSascha Silbe <sascha-pgp@silbe.org>
Tue, 18 Jan 2011 18:28:43 +0000 (19:28 +0100)
committerRich Lane <rlane@club.cc.cmu.edu>
Wed, 19 Jan 2011 03:26:42 +0000 (19:26 -0800)
commitabae119526c5c705042679f17b04c39c28b97cb2
tree0e05fdb48011191a6f7d230c87629d319ec0b46e
parent74cf329d3b63a519eb86a422e9b3947b3cd1563d
ensure sources.yaml gets flushed to disk

Before renaming sources.yaml we need to fsync() it, otherwise we could end up
with an empty file in case of a crash [1].

[1] http://thunk.org/tytso/blog/2009/03/12/delayed-allocation-and-the-zero-length-file-problem/

Signed-off-by: Sascha Silbe <sascha-pgp@silbe.org>
bin/sup-config
lib/sup.rb
lib/sup/source.rb