summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2008-02-05 03:25:54 +0100
committerFelix Fietkau <nbd@openwrt.org>2008-02-05 03:25:54 +0100
commitcba72526bbd55932caf58bcb673b8fa8b1b98c89 (patch)
tree0aac7e13456262dccaaf5a2e76f1fe7f30cf9251 /util.c
parentd0cd0868cd5e071df9f560455542f6df041056ad (diff)
downloaduci-cba72526bbd55932caf58bcb673b8fa8b1b98c89.tar.gz
fix an off-by-one error that prevented the open() check from succeeding, if stdin is closedv0.2.2
Diffstat (limited to 'util.c')
-rw-r--r--util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util.c b/util.c
index 4713c74..bc137c3 100644
--- a/util.c
+++ b/util.c
@@ -396,7 +396,7 @@ static FILE *uci_open_stream(struct uci_context *ctx, const char *filename, int
}
fd = open(filename, mode, UCI_FILEMODE);
- if (fd <= 0)
+ if (fd < 0)
goto error;
if (flock(fd, (write ? LOCK_EX : LOCK_SH)) < 0)