diff options
author | Felix Fietkau <nbd@openwrt.org> | 2008-02-05 03:25:54 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2008-02-05 03:25:54 +0100 |
commit | cba72526bbd55932caf58bcb673b8fa8b1b98c89 (patch) | |
tree | 0aac7e13456262dccaaf5a2e76f1fe7f30cf9251 /util.c | |
parent | d0cd0868cd5e071df9f560455542f6df041056ad (diff) | |
download | uci-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) |