Skip to content

Commit add0b12

Browse files
committed
remove startup_p var references
1 parent e78bdbe commit add0b12

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

sshd.c

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@ ServerOptions options;
129129
* the first connection.
130130
*/
131131
int debug_flag = 0;
132-
#ifdef WINDOWS
133-
debug_startup_p = -1;
134-
#endif /* WINDOWS */
135132

136133
/* Saved arguments to main(). */
137134
static char **saved_argv;
@@ -1247,17 +1244,10 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s,
12471244
close_listen_socks();
12481245
*sock_in = *newsock;
12491246
*sock_out = *newsock;
1250-
close(startup_p[0]);
12511247
#ifndef WINDOWS
1252-
close(startup_p[1]);
1253-
#endif /* WINDOWS */
1254-
startup_pipe = -1;
1255-
#ifdef WINDOWS
1256-
debug_startup_p = startup_p[1];
1257-
#else
12581248
send_rexec_state(config_s[0]);
12591249
close(config_s[0]);
1260-
#endif /* WINDOWS */
1250+
#endif /* !WINDOWS */
12611251
free(pfd);
12621252
return;
12631253
}
@@ -1269,14 +1259,13 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s,
12691259
if (posix_spawn_file_actions_init(&actions) != 0 ||
12701260
posix_spawn_file_actions_adddup2(&actions, *newsock, STDIN_FILENO) != 0 ||
12711261
posix_spawn_file_actions_adddup2(&actions, *newsock, STDOUT_FILENO) != 0 ||
1272-
posix_spawn_file_actions_adddup2(&actions, startup_p[1], REEXEC_STARTUP_PIPE_FD) != 0 ||
12731262
posix_spawn_file_actions_adddup2(&actions, config_s[1], REEXEC_CONFIG_PASS_FD) != 0 ||
12741263
posix_spawnattr_init(&attributes) != 0 ||
12751264
posix_spawnattr_setflags(&attributes, POSIX_SPAWN_SETPGROUP) != 0 ||
12761265
posix_spawnattr_setpgroup(&attributes, 0) != 0)
12771266
error("posix_spawn initialization failed");
12781267
else {
1279-
child = child_register(startup_p[0], *newsock);
1268+
child = child_register(config_s[0], *newsock);
12801269
if (posix_spawn(&child->pid, rexec_argv[0], &actions, &attributes, rexec_argv, NULL) != 0)
12811270
error("%s, posix_spawn failed", __func__);
12821271
posix_spawn_file_actions_destroy(&actions);
@@ -2037,7 +2026,6 @@ main(int ac, char **av)
20372026
if (posix_spawn_file_actions_init(&actions) != 0 ||
20382027
(debug_flag && posix_spawn_file_actions_adddup2(&actions, newsock, STDIN_FILENO) != 0) ||
20392028
(debug_flag && posix_spawn_file_actions_adddup2(&actions, newsock, STDOUT_FILENO) != 0) ||
2040-
(debug_flag && posix_spawn_file_actions_adddup2(&actions, debug_startup_p, REEXEC_STARTUP_PIPE_FD) != 0) ||
20412029
posix_spawn_file_actions_adddup2(&actions, config_s[1], REEXEC_CONFIG_PASS_FD) != 0 ||
20422030
posix_spawnattr_init(&attributes) != 0 ||
20432031
posix_spawnattr_setflags(&attributes, POSIX_SPAWN_SETPGROUP) != 0 ||
@@ -2050,9 +2038,8 @@ main(int ac, char **av)
20502038
posix_spawn_file_actions_destroy(&actions);
20512039
posix_spawnattr_destroy(&attributes);
20522040
}
2053-
close(debug_startup_p);
20542041
close(config_s[1]);
2055-
send_rexec_state(config_s[0], cfg);
2042+
send_rexec_state(config_s[0]);
20562043
close(config_s[0]);
20572044
close(newsock);
20582045
cleanup_exit(255);

0 commit comments

Comments
 (0)