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

dmfilemapd: log closedir errors with log_sys_error()

This commit is contained in:
Bryn M. Reeves 2017-03-29 16:04:15 +01:00
parent 5dfd35f2f8
commit d71071a1af

View File

@ -179,13 +179,16 @@ static int _is_open_in_pid(pid_t pid, const char *path)
}
link_buf[len] = '\0';
if (!strcmp(deleted_path, link_buf)) {
closedir(pid_d);
if (closedir(pid_d))
log_sys_error("closedir", path_buf);
return 1;
}
}
bad:
closedir(pid_d);
if (closedir(pid_d))
log_sys_error("closedir", path_buf);
return 0;
}
@ -225,11 +228,15 @@ static int _is_open(const char *path)
if (!pid)
continue;
if (_is_open_in_pid(pid, path)) {
closedir(proc_d);
if (closedir(pid_d))
log_sys_error("closedir", DEFAULT_PROC_DIR);
return 1;
}
}
closedir(proc_d);
if (closedir(pid_d))
log_sys_error("closedir", DEFAULT_PROC_DIR);
return 0;
}