summaryrefslogtreecommitdiffstats
path: root/src/basic/rlimit-util.c
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/basic/rlimit-util.c
parentMerge pull request #18380 from yuwata/test-network-ipv6-proxy-ndp (diff)
downloadsystemd-fe96c0f86d15e844d74d539c6cff7f971078cf84.tar.xz
systemd-fe96c0f86d15e844d74d539c6cff7f971078cf84.zip
treewide: tighten variable scope in loops (#18372)
Also use _cleanup_free_ in one more place.
Diffstat (limited to 'src/basic/rlimit-util.c')
-rw-r--r--src/basic/rlimit-util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c
index 880976312c..e01ffdb074 100644
--- a/src/basic/rlimit-util.c
+++ b/src/basic/rlimit-util.c
@@ -50,13 +50,13 @@ int setrlimit_closest(int resource, const struct rlimit *rlim) {
}
int setrlimit_closest_all(const struct rlimit *const *rlim, int *which_failed) {
- int i, r;
+ int r;
assert(rlim);
/* On failure returns the limit's index that failed in *which_failed, but only if non-NULL */
- for (i = 0; i < _RLIMIT_MAX; i++) {
+ for (int i = 0; i < _RLIMIT_MAX; i++) {
if (!rlim[i])
continue;