summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-daemon
diff options
context:
space:
mode:
authorSusant Sahani <ssahani@vmware.com>2021-01-27 08:19:39 +0100
committerGitHub <noreply@github.com>2021-01-27 08:19:39 +0100
commitfe96c0f86d15e844d74d539c6cff7f971078cf84 (patch)
treecb4f1a6248826c163b766c1be5d82d882f9fbb28 /src/libsystemd/sd-daemon
parent37baf8db563f085e8867a0764f9832dcd7e94605 (diff)
downloadsystemd-fe96c0f86d15e844d74d539c6cff7f971078cf84.tar.gz
treewide: tighten variable scope in loops (#18372)
Also use _cleanup_free_ in one more place.
Diffstat (limited to 'src/libsystemd/sd-daemon')
-rw-r--r--src/libsystemd/sd-daemon/sd-daemon.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd/sd-daemon/sd-daemon.c b/src/libsystemd/sd-daemon/sd-daemon.c
index 6f0b975627..b373c173c1 100644
--- a/src/libsystemd/sd-daemon/sd-daemon.c
+++ b/src/libsystemd/sd-daemon/sd-daemon.c
@@ -40,7 +40,7 @@ static void unsetenv_all(bool unset_environment) {
_public_ int sd_listen_fds(int unset_environment) {
const char *e;
- int n, r, fd;
+ int n, r;
pid_t pid;
e = getenv("LISTEN_PID");
@@ -75,7 +75,7 @@ _public_ int sd_listen_fds(int unset_environment) {
goto finish;
}
- for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + n; fd ++) {
+ for (int fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + n; fd ++) {
r = fd_cloexec(fd, true);
if (r < 0)
goto finish;