summaryrefslogtreecommitdiff
path: root/libdaemon
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2021-09-19 20:25:58 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2021-09-20 14:26:09 +0200
commit825e49a2447810a806905723bc91072eb7b8b423 (patch)
tree4a795d9c8d393c6172c914b524fc5ae1a5b6d48c /libdaemon
parent376e7072323bc394341c7b9a43a7ca51c2b9e400 (diff)
downloadlvm2-825e49a2447810a806905723bc91072eb7b8b423.tar.gz
cov: use different variable name
Better for Coverity to see no change for possibly opened handle.
Diffstat (limited to 'libdaemon')
-rw-r--r--libdaemon/server/daemon-server.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index 1e900261c..aeb1870a3 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -326,7 +326,7 @@ static void _remove_lockfile(const char *file)
static void _daemonise(daemon_state s)
{
int child_status;
- int fd;
+ int fd, ffd;
pid_t pid;
struct rlimit rlim;
struct timeval tval;
@@ -394,17 +394,17 @@ static void _daemonise(daemon_state s)
/* Switch to sysconf(_SC_OPEN_MAX) ?? */
if (getrlimit(RLIMIT_NOFILE, &rlim) < 0)
- fd = 256; /* just have to guess */
+ ffd = 256; /* just have to guess */
else
- fd = rlim.rlim_cur;
+ ffd = rlim.rlim_cur;
- for (--fd; fd > STDERR_FILENO; fd--) {
+ for (--ffd; ffd > STDERR_FILENO; ffd--) {
#ifdef __linux__
/* Do not close fds preloaded by systemd! */
- if (_systemd_activation && fd == SD_FD_SOCKET_SERVER)
+ if (_systemd_activation && ffd == SD_FD_SOCKET_SERVER)
continue;
#endif
- (void) close(fd);
+ (void) close(ffd);
}
setsid();