From 814bff5e28823e9cc62545cb1d42d6f85cdd3a48 Mon Sep 17 00:00:00 2001 From: Matteo Croce Date: Tue, 12 Aug 2025 18:53:59 +0200 Subject: [PATCH] core: suppress warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Avoid definition of `exec_context_get_tty_for_pam` if pam support is disabled, to avoid the following warning: ``` ../src/core/exec-invoke.c:1231:12: warning: ‘exec_context_get_tty_for_pam’ defined but not used [-Wunused-function] 1231 | static int exec_context_get_tty_for_pam(const ExecContext *context, char **ret) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- src/core/exec-invoke.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/exec-invoke.c b/src/core/exec-invoke.c index 7a36d8c1c36..ddf888ee8a2 100644 --- a/src/core/exec-invoke.c +++ b/src/core/exec-invoke.c @@ -1228,6 +1228,7 @@ static int attach_to_subcgroup( return 0; } +#if HAVE_PAM static int exec_context_get_tty_for_pam(const ExecContext *context, char **ret) { _cleanup_free_ char *tty = NULL; int r; @@ -1282,6 +1283,7 @@ static int exec_context_get_tty_for_pam(const ExecContext *context, char **ret) *ret = TAKE_PTR(tty); return 1; } +#endif static int setup_pam( const ExecContext *context, -- 2.47.3