From 2ab784440a2cbde7448a3f5e315f7e8a8cbcf729 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 15 Oct 2018 14:34:31 +0200 Subject: [PATCH] cov: fix leaking openned file descriptors Once the FD is no longer needed, close it. --- tools/pvscan.c | 2 ++ 1 file changed, 2 insertions(+) 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;