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) {
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
This commit is contained in:
Matteo Croce
2025-08-12 19:45:04 +01:00
committed by Luca Boccassi
parent 5bd2538405
commit 814bff5e28
+2
View File
@@ -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,