projects
/
project
/
uci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
add an extra check
[project/uci.git]
/
file.c
diff --git
a/file.c
b/file.c
index
6eaa5ec
..
4650a96
100644
(file)
--- a/
file.c
+++ b/
file.c
@@
-567,7
+567,9
@@
int uci_load(struct uci_context *ctx, const char *name, struct uci_package **pac
if (fd <= 0)
UCI_THROW(ctx, UCI_ERR_IO);
- flock(fd, LOCK_SH);
+ if (flock(fd, LOCK_SH) < 0)
+ UCI_THROW(ctx, UCI_ERR_IO);
+
file = fdopen(fd, "r");
if (!file)
UCI_THROW(ctx, UCI_ERR_IO);