diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-03-16 22:32:23 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-03-19 08:33:33 +0900 |
commit | de010b0b2e50cf0b3837ce350b116bc92605f67a (patch) | |
tree | 226685fbb97461692562035501ebc21a314f718c /src/tty-ask-password-agent | |
parent | 80a226b26b5e00a2ef9e85d1321da44cd14d051b (diff) | |
download | systemd-de010b0b2e50cf0b3837ce350b116bc92605f67a.tar.gz |
strv: make iterator in STRV_FOREACH() declaread in the loop
This also avoids multiple evaluations in STRV_FOREACH_BACKWARDS()
Diffstat (limited to 'src/tty-ask-password-agent')
-rw-r--r-- | src/tty-ask-password-agent/tty-ask-password-agent.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c index 2535593775..7fc0ed7c8d 100644 --- a/src/tty-ask-password-agent/tty-ask-password-agent.c +++ b/src/tty-ask-password-agent/tty-ask-password-agent.c @@ -59,7 +59,7 @@ static int send_passwords(const char *socket_name, char **passwords) { union sockaddr_union sa; socklen_t sa_len; size_t packet_length = 1; - char **p, *d; + char *d; ssize_t n; int r; @@ -554,8 +554,6 @@ static int ask_on_this_console(const char *tty, pid_t *ret_pid, char **arguments if (r < 0) return r; if (r == 0) { - char **i; - assert_se(prctl(PR_SET_PDEATHSIG, SIGHUP) >= 0); STRV_FOREACH(i, arguments) { @@ -632,7 +630,6 @@ static int ask_on_consoles(char *argv[]) { _cleanup_set_free_ Set *pids = NULL; _cleanup_strv_free_ char **consoles = NULL, **arguments = NULL; siginfo_t status = {}; - char **tty; pid_t pid; int r; |