From: Matteo Croce Date: Tue, 12 Aug 2025 16:53:59 +0000 (+0200) Subject: core: suppress warning X-Git-Tag: v258-rc3~53 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=814bff5e28823e9cc62545cb1d42d6f85cdd3a48;p=thirdparty%2Fsystemd.git core: suppress warning 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) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- 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,