make sure data is on disk, don't get empty files on ext4/ext3=writeback.
authorbarbieri <barbieri>
Tue, 17 Mar 2009 20:49:36 +0000 (20:49 +0000)
committerbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 17 Mar 2009 20:49:36 +0000 (20:49 +0000)
Ok, raster said it would not happen but just crashed my machine and
e.cfg was lost due ext4 being in writeback by default. Accordingly to
Theodore Ts'o
(http://thunk.org/tytso/blog/2009/03/15/dont-fear-the-fsync/) we
should fsync even on open-write-close+rename case.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eet@39536 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/eet_lib.c

index 80858b5..a01f983 100644 (file)
@@ -557,6 +557,7 @@ eet_flush2(Eet_File *ef)
 
    /* flush all write to the file. */
    fflush(ef->fp);
+   fsync(fileno(ef->fp));
 
    /* append signature if required */
    if (ef->key)