strv: make iterator in STRV_FOREACH() declaread in the loop

This also avoids multiple evaluations in STRV_FOREACH_BACKWARDS()
This commit is contained in:
Yu Watanabe
2022-03-19 08:33:33 +09:00
parent 80a226b26b
commit de010b0b2e
210 changed files with 109 additions and 621 deletions
-3
View File
@@ -49,7 +49,6 @@ static int add_epoll(int epoll_fd, int fd) {
}
static int open_sockets(int *epoll_fd, bool accept) {
char **address;
int n, fd, r, count = 0;
n = sd_listen_fds(true);
@@ -125,7 +124,6 @@ static int open_sockets(int *epoll_fd, bool accept) {
static int exec_process(const char *name, char **argv, int start_fd, size_t n_fds) {
_cleanup_strv_free_ char **envp = NULL;
const char *var;
char **s;
int r;
if (arg_inetd && n_fds != 1)
@@ -390,7 +388,6 @@ static int parse_argv(int argc, char *argv[]) {
case ARG_FDNAME: {
_cleanup_strv_free_ char **names = NULL;
char **s;
names = strv_split(optarg, ":");
if (!names)