From b0d40109a67a99bf568c168a31f37955a07d7da4 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 21 Sep 2021 20:20:53 +0200 Subject: cov: ignore leak of fd descriptor There is no 'fd' leak. --- libdm/dm-tools/dmfilemapd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'libdm') diff --git a/libdm/dm-tools/dmfilemapd.c b/libdm/dm-tools/dmfilemapd.c index d7ca71d7e..d547e59d5 100644 --- a/libdm/dm-tools/dmfilemapd.c +++ b/libdm/dm-tools/dmfilemapd.c @@ -671,12 +671,11 @@ static int _daemonise(struct filemap_monitor *fm) (void) close(fd); } /* TODO: Use libdaemon/server/daemon-server.c _daemonise() */ - for (ffd = (int) sysconf(_SC_OPEN_MAX) - 1; ffd > STDERR_FILENO; --ffd) { - if (ffd == fm->fd) - continue; - (void) close(ffd); - } + for (ffd = (int) sysconf(_SC_OPEN_MAX) - 1; ffd > STDERR_FILENO; --ffd) + if (ffd != fm->fd) + (void) close(ffd); + /* coverity[leaked_handle] no leak */ return 1; } -- cgit v1.2.1