1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 18:55:19 +03:00

coverity: commit ba2302346 - report log_sys_error properly

log_sys_error uses errno, hence we need to report the first
failure before reporting another failure that uses errno as well.
This commit is contained in:
Peter Rajnoha 2014-11-12 15:16:54 +01:00
parent c03d8473ea
commit 359dc6fa76

View File

@ -1873,9 +1873,9 @@ static int _pool_callback(struct dm_tree_node *node,
}
/* let's assume there is no problem to read 64 bytes */
if (read(fd, buf, sizeof(buf)) < sizeof(buf)) {
log_sys_error("read", argv[args]);
if (close(fd))
log_sys_error("close", argv[args]);
log_sys_error("read", argv[args]);
return 0;
}
for (ret = 0; ret < DM_ARRAY_SIZE(buf); ++ret)