aboutsummaryrefslogtreecommitdiff
path: root/ubi-utils
diff options
context:
space:
mode:
Diffstat (limited to 'ubi-utils')
-rw-r--r--ubi-utils/libubi.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/ubi-utils/libubi.c b/ubi-utils/libubi.c
index 598191e..1e08b7d 100644
--- a/ubi-utils/libubi.c
+++ b/ubi-utils/libubi.c
@@ -188,10 +188,8 @@ static int read_data(const char *file, void *buf, int buf_len)
goto out_error;
}
- if (close(fd)) {
- sys_errmsg("close failed on \"%s\"", file);
- return -1;
- }
+ if (close(fd))
+ return sys_errmsg("close failed on \"%s\"", file);
return rd;
@@ -420,6 +418,9 @@ static int vol_node2nums(struct libubi *lib, const char *node, int *dev_num,
return -1;
}
+ if (close(fd))
+ return sys_errmsg("close failed on \"%s\"", file);
+
*dev_num = i;
*vol_id = minor - 1;
errno = 0;
@@ -911,6 +912,9 @@ int ubi_probe_node(libubi_t desc, const char *node)
if (fd == -1)
goto out_not_ubi;
+ if (close(fd))
+ sys_errmsg("close failed on \"%s\"", file);
+
return 2;
out_not_ubi: