From 666062c07a74ecabb230839e78c8fbf1267b19e7 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Thu, 6 Mar 2025 20:26:07 +0100 Subject: [PATCH] core: Debug log if we cannot change the controlling terminal --- src/core/exec-invoke.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/exec-invoke.c b/src/core/exec-invoke.c index f952079a527..2cee136feeb 100644 --- a/src/core/exec-invoke.c +++ b/src/core/exec-invoke.c @@ -351,9 +351,9 @@ static int setup_input( if (dup2(params->stdin_fd, STDIN_FILENO) < 0) return -errno; - /* Try to make this the controlling tty, if it is a tty */ - if (isatty_safe(STDIN_FILENO)) - (void) ioctl(STDIN_FILENO, TIOCSCTTY, context->std_input == EXEC_INPUT_TTY_FORCE); + /* Try to make this our controlling tty, if it is a tty */ + if (isatty_safe(STDIN_FILENO) && ioctl(STDIN_FILENO, TIOCSCTTY, context->std_input == EXEC_INPUT_TTY_FORCE) < 0) + log_debug_errno(errno, "Failed to make standard input TTY our controlling terminal: %m"); return STDIN_FILENO; } -- 2.47.3