]> pilppa.com Git - uci.git/commitdiff
add missing fflush() on close - fixes a bug in the lock/unlock order (thx, Cyrus)
authorFelix Fietkau <nbd@openwrt.org>
Tue, 24 Mar 2009 15:48:13 +0000 (16:48 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 24 Mar 2009 15:48:13 +0000 (16:48 +0100)
util.c

diff --git a/util.c b/util.c
index cb88968dc3eef74766b1517e75defadebcbf1b9e..984305871ed306d4aee131b6a073f71c862c7f53 100644 (file)
--- a/util.c
+++ b/util.c
@@ -478,6 +478,7 @@ static void uci_close_stream(FILE *stream)
        if (!stream)
                return;
 
+       fflush(stream);
        fd = fileno(stream);
        flock(fd, LOCK_UN);
        fclose(stream);