1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-31 07:51:21 +03:00

Inline some iterator variables

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-07-05 21:56:39 +02:00
parent 0086ef19cb
commit 6c1abe8807
2 changed files with 3 additions and 8 deletions

View File

@ -563,7 +563,6 @@ _const_ static const char* listen_lookup(int family, int type) {
}
static void socket_dump(Unit *u, FILE *f, const char *prefix) {
SocketExecCommand c;
Socket *s = SOCKET(u);
SocketPort *p;
const char *prefix2, *str;
@ -797,7 +796,7 @@ static void socket_dump(Unit *u, FILE *f, const char *prefix) {
exec_context_dump(&s->exec_context, f, prefix);
kill_context_dump(&s->kill_context, f, prefix);
for (c = 0; c < _SOCKET_EXEC_COMMAND_MAX; c++) {
for (SocketExecCommand c = 0; c < _SOCKET_EXEC_COMMAND_MAX; c++) {
if (!s->exec_command[c])
continue;
@ -3259,11 +3258,9 @@ int socket_collect_fds(Socket *s, int **fds) {
return -ENOMEM;
LIST_FOREACH(port, p, s->ports) {
size_t i;
if (p->fd >= 0)
rfds[k++] = p->fd;
for (i = 0; i < p->n_auxiliary_fds; ++i)
for (size_t i = 0; i < p->n_auxiliary_fds; ++i)
rfds[k++] = p->auxiliary_fds[i];
}

View File

@ -389,10 +389,8 @@ int bus_creds_dump(sd_bus_creds *c, FILE *f, bool terse) {
fprintf(f, "%sFSGID=%s"GID_FMT"%s", prefix, color, c->fsgid, suffix);
if (c->mask & SD_BUS_CREDS_SUPPLEMENTARY_GIDS) {
unsigned i;
fprintf(f, "%sSupplementaryGIDs=%s", prefix, color);
for (i = 0; i < c->n_supplementary_gids; i++)
for (unsigned i = 0; i < c->n_supplementary_gids; i++)
fprintf(f, "%s" GID_FMT, i > 0 ? " " : "", c->supplementary_gids[i]);
fprintf(f, "%s", suffix);
}