const char *path = exec_context_tty_path(context);
- if (p && p->stdin_fd >= 0 && isatty_safe(p->stdin_fd))
- fd = p->stdin_fd;
+ if (p && p->stdout_fd >= 0 && isatty_safe(p->stdout_fd))
+ fd = p->stdout_fd;
else if (path && (context->tty_path || is_terminal_input(context->std_input) ||
is_terminal_output(context->std_output) || is_terminal_output(context->std_error))) {
fd = _fd = open_terminal(path, O_RDWR|O_NOCTTY|O_CLOEXEC|O_NONBLOCK);
pn = os_release_pretty_name(pretty_name, os_name);
ac = isempty(ansi_color) ? "0" : ansi_color;
- (void) terminal_reset_defensive(STDIN_FILENO, /* switch_to_text= */ false);
+ (void) terminal_reset_defensive(STDOUT_FILENO, /* switch_to_text= */ false);
if (colors_enabled())
printf("\nWelcome to your new installation of \x1B[%sm%s\x1B[0m!\n", ac, pn);
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
- (void) terminal_reset_defensive(STDIN_FILENO, /* switch_to_text= */ false);
+ (void) terminal_reset_defensive(STDOUT_FILENO, /* switch_to_text= */ false);
for (;;) {
username = mfree(username);
TEST(terminal_reset_defensive) {
int r;
- r = terminal_reset_defensive(STDIN_FILENO, /* switch_to_text= */ false);
+ r = terminal_reset_defensive(STDOUT_FILENO, /* switch_to_text= */ false);
if (r < 0)
log_notice_errno(r, "Failed to reset terminal: %m");
}