From: barbieri Date: Tue, 17 Mar 2009 20:49:36 +0000 (+0000) Subject: make sure data is on disk, don't get empty files on ext4/ext3=writeback. X-Git-Tag: submit/2.0alpha-wayland/20121127.222001~520 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ebe55024d75e8da27d7f3ade3504d261f2c8a45f;p=profile%2Fivi%2Feet.git make sure data is on disk, don't get empty files on ext4/ext3=writeback. 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 --- diff --git a/src/lib/eet_lib.c b/src/lib/eet_lib.c index 80858b5..a01f983 100644 --- a/src/lib/eet_lib.c +++ b/src/lib/eet_lib.c @@ -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)