terminal-util: change 2nd parameter of terminal_reset_defensive() to flags

let's convert the 2nd argumeng form a boolean to a proper flags
parameter. Doesn't change behaviour in anyway, but is more readable, and
prepares ground for adding more flags soon.
This commit is contained in:
Lennart Poettering
2025-02-27 15:13:15 +01:00
parent ddb503b7f6
commit 9ab703d8e1
8 changed files with 17 additions and 13 deletions
+2 -2
View File
@@ -668,7 +668,7 @@ static int setup_confirm_stdio(
if (r < 0)
return r;
r = terminal_reset_defensive(fd, /* switch_to_text= */ true);
r = terminal_reset_defensive(fd, TERMINAL_RESET_SWITCH_TO_TEXT);
if (r < 0)
return r;
@@ -4375,7 +4375,7 @@ static void prepare_terminal(
if (lock_fd < 0)
log_exec_debug_errno(context, p, lock_fd, "Failed to lock /dev/console, ignoring: %m");
(void) terminal_reset_defensive(STDOUT_FILENO, /* switch_to_text= */ false);
(void) terminal_reset_defensive(STDOUT_FILENO, /* flags= */ 0);
}
(void) exec_context_apply_tty_size(context, STDIN_FILENO, STDOUT_FILENO, /* tty_path= */ NULL);