core: make is_terminal_input() and friends inline

Then, rename them to exec_input_is_terminal() and so on.
This commit is contained in:
Yu Watanabe
2025-08-13 23:43:52 +09:00
parent 18924bc784
commit da34c27bb1
3 changed files with 36 additions and 50 deletions
+20
View File
@@ -458,6 +458,26 @@ typedef struct ExecParameters {
.pidref_transport_fd = -EBADF, \
}
static inline bool exec_input_is_terminal(ExecInput i) {
return IN_SET(i,
EXEC_INPUT_TTY,
EXEC_INPUT_TTY_FORCE,
EXEC_INPUT_TTY_FAIL);
}
static inline bool exec_output_is_terminal(ExecOutput o) {
return IN_SET(o,
EXEC_OUTPUT_TTY,
EXEC_OUTPUT_KMSG_AND_CONSOLE,
EXEC_OUTPUT_JOURNAL_AND_CONSOLE);
}
static inline bool exec_output_is_kmsg(ExecOutput o) {
return IN_SET(o,
EXEC_OUTPUT_KMSG,
EXEC_OUTPUT_KMSG_AND_CONSOLE);
}
int exec_spawn(
Unit *unit,
ExecCommand *command,