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 5ba5d9e..fc8c201 100644 (file)
--- a/utils.c
+++ b/utils.c
@@ -602,6 +602,7 @@ fw3_write_statefile(void *state)
                        uci_unload(s->uci, p);
                }
 
                        uci_unload(s->uci, p);
                }
 
+               fsync(fileno(sf));
                fclose(sf);
        }
 }
                fclose(sf);
        }
 }