summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2017-03-29 16:48:32 +0100
committerBryn M. Reeves <bmr@redhat.com>2017-03-29 16:48:32 +0100
commit481a522dd76baaa36b9e903dcd23d66be0b6754a (patch)
tree9ec1a1e707600c01880c58fbc8469211facbf9e2
parentd71071a1afe50214f15fa3dd8de0cc207d409147 (diff)
downloadlvm2-481a522dd76baaa36b9e903dcd23d66be0b6754a.tar.gz
dmfilemapd: do not closdir(pid_d) unless it is open
-rw-r--r--daemons/dmfilemapd/dmfilemapd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/daemons/dmfilemapd/dmfilemapd.c b/daemons/dmfilemapd/dmfilemapd.c
index 391003e8d..dec74ec4b 100644
--- a/daemons/dmfilemapd/dmfilemapd.c
+++ b/daemons/dmfilemapd/dmfilemapd.c
@@ -151,7 +151,7 @@ static int _is_open_in_pid(pid_t pid, const char *path)
if (dm_snprintf(path_buf, sizeof(path_buf),
DEFAULT_PROC_DIR "%d/fd", pid) < 0) {
log_error("Could not format pid path.");
- goto bad;
+ return 0;
}
/*
@@ -160,12 +160,13 @@ static int _is_open_in_pid(pid_t pid, const char *path)
if (dm_snprintf(deleted_path, sizeof(deleted_path), "%s %s",
path, PROC_FD_DELETED_STR) < 0) {
log_error("Could not format check path.");
+ return 0;
}
pid_d = opendir(path_buf);
if (!pid_d) {
log_error("Could not open proc path: %s.", path_buf);
- goto bad;
+ return 0;
}
while ((pid_dp = readdir(pid_d)) != NULL) {