summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-02-20 19:09:36 +0100
committerAlejandro Colomar <alx@kernel.org>2024-02-21 18:17:12 +0100
commit561cbbe880a7753c1908d4d87f6482723e95dc37 (patch)
treec954203d3dbecab8b61491e9be4bee44d6d8302f
parent261f40423a60b052674f823ea04b9e6c9b514767 (diff)
lib/utmp.c: Merge preprocessor conditionals
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com> Signed-off-by: Alejandro Colomar <alx@kernel.org> Cherry-picked-from: e5815acf371f ("lib/utmp.c: Merge preprocessor conditionals") [alx: This is needed by 1af6b68cbeb9 ("lib/utmp.c: Use the appropriate autotools macros for struct utmpx")] Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--lib/utmp.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/utmp.c b/lib/utmp.c
index ab2ee7ba..dc9e2b7f 100644
--- a/lib/utmp.c
+++ b/lib/utmp.c
@@ -189,12 +189,11 @@ get_session_host(char **out)
}
-#ifndef USE_PAM
+#if !defined(USE_PAM) && !defined(HAVE_UPDWTMPX)
/*
* Some systems already have updwtmpx(). Others
* don't, so we re-implement these functions if necessary.
*/
-# ifndef HAVE_UPDWTMPX
static void
updwtmpx(const char *filename, const struct utmpx *ut)
{
@@ -206,8 +205,7 @@ updwtmpx(const char *filename, const struct utmpx *ut)
close (fd);
}
}
-# endif /* ! HAVE_UPDWTMPX */
-#endif /* ! USE_PAM */
+#endif
/*