From 825e49a2447810a806905723bc91072eb7b8b423 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sun, 19 Sep 2021 20:25:58 +0200 Subject: cov: use different variable name Better for Coverity to see no change for possibly opened handle. --- libdm/dm-tools/dmfilemapd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libdm') diff --git a/libdm/dm-tools/dmfilemapd.c b/libdm/dm-tools/dmfilemapd.c index 2a86810ed..3799efd83 100644 --- a/libdm/dm-tools/dmfilemapd.c +++ b/libdm/dm-tools/dmfilemapd.c @@ -629,7 +629,7 @@ check_unlinked: static int _daemonise(struct filemap_monitor *fm) { pid_t pid = 0; - int fd; + int fd, ffd; if (!setsid()) { _early_log("setsid failed."); @@ -670,10 +670,10 @@ static int _daemonise(struct filemap_monitor *fm) (void) close(fd); } /* TODO: Use libdaemon/server/daemon-server.c _daemonise() */ - for (fd = (int) sysconf(_SC_OPEN_MAX) - 1; fd > STDERR_FILENO; fd--) { - if (fd == fm->fd) + for (ffd = (int) sysconf(_SC_OPEN_MAX) - 1; ffd > STDERR_FILENO; --ffd) { + if (ffd == fm->fd) continue; - (void) close(fd); + (void) close(ffd); } return 1; -- cgit v1.2.1