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 cb88968..9843058 100644 (file)
--- a/util.c
+++ b/util.c
@@ -478,6 +478,7 @@ static void uci_close_stream(FILE *stream)
        if (!stream)
                return;
 
        if (!stream)
                return;
 
+       fflush(stream);
        fd = fileno(stream);
        flock(fd, LOCK_UN);
        fclose(stream);
        fd = fileno(stream);
        flock(fd, LOCK_UN);
        fclose(stream);