diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2021-09-19 20:25:58 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2021-09-20 14:26:09 +0200 |
commit | 825e49a2447810a806905723bc91072eb7b8b423 (patch) | |
tree | 4a795d9c8d393c6172c914b524fc5ae1a5b6d48c /libdm | |
parent | 376e7072323bc394341c7b9a43a7ca51c2b9e400 (diff) | |
download | lvm2-825e49a2447810a806905723bc91072eb7b8b423.tar.gz |
cov: use different variable name
Better for Coverity to see no change for possibly opened handle.
Diffstat (limited to 'libdm')
-rw-r--r-- | libdm/dm-tools/dmfilemapd.c | 8 |
1 files changed, 4 insertions, 4 deletions
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; |