Force fsync() after writing statefile
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 8 May 2013 13:12:13 +0000 (15:12 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 8 May 2013 13:24:20 +0000 (15:24 +0200)
utils.c

diff --git a/utils.c b/utils.c
index 5ba5d9e3c9c51edf321325b836f8d842048a3674..fc8c201c7b7958dffb3fbc39f1b628f821d056cd 100644 (file)
--- a/utils.c
+++ b/utils.c
@@ -602,6 +602,7 @@ fw3_write_statefile(void *state)
                        uci_unload(s->uci, p);
                }
 
+               fsync(fileno(sf));
                fclose(sf);
        }
 }