diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2018-10-15 14:34:31 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2018-10-15 17:49:44 +0200 |
commit | 2ab784440a2cbde7448a3f5e315f7e8a8cbcf729 (patch) | |
tree | 5fef64fc6abb28f716736c5ecbe3338a6a58eef1 | |
parent | 9b85ecb85b2875bd6743a97147355218879aef3a (diff) | |
download | lvm2-2ab784440a2cbde7448a3f5e315f7e8a8cbcf729.tar.gz |
cov: fix leaking openned file descriptors
Once the FD is no longer needed, close it.
-rw-r--r-- | tools/pvscan.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/pvscan.c b/tools/pvscan.c index a4c0244eb..fd75362f5 100644 --- a/tools/pvscan.c +++ b/tools/pvscan.c @@ -216,6 +216,8 @@ static void _online_pvid_file_remove_devno(int major, int minor) } rv = read(fd, buf_in, sizeof(buf_in)); + if (close(fd)) + log_sys_debug("close", path); if (!rv || rv < 0) { log_debug("Failed to read %s", path); continue; |