1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

debug: tracing close errors

This commit is contained in:
Zdenek Kabelac 2018-12-21 20:26:15 +01:00
parent 095c9791ca
commit 2724a09e58
2 changed files with 8 additions and 4 deletions

View File

@ -58,15 +58,18 @@ int dev_is_pmem(struct device *dev)
if (!fgets(buffer, sizeof(buffer), fp)) {
log_warn("Failed to read %s.", path);
fclose(fp);
if (fclose(fp))
log_sys_debug("fclose", path);
return 0;
} else if (sscanf(buffer, "%d", &is_pmem) != 1) {
log_warn("Failed to parse %s '%s'.", path, buffer);
fclose(fp);
if (fclose(fp))
log_sys_debug("fclose", path);
return 0;
}
fclose(fp);
if (fclose(fp))
log_sys_debug("fclose", path);
if (is_pmem) {
log_debug("%s is pmem", dev_name(dev));

View File

@ -291,7 +291,8 @@ static int _online_pvid_file_create(struct device *dev)
if (rv < 0) {
log_error("Failed to write fd %d buf %s dev %s to %s: %d",
fd, buf, dev_name(dev), path, errno);
close(fd);
if (close(fd))
log_sys_debug("close", path);
return 0;
}
len -= rv;