]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/utmp.c: Merge preprocessor conditionals
authorAlejandro Colomar <alx@kernel.org>
Tue, 20 Feb 2024 18:09:36 +0000 (19:09 +0100)
committerAlejandro Colomar <alx@kernel.org>
Wed, 21 Feb 2024 17:17:12 +0000 (18:17 +0100)
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>
lib/utmp.c

index ab2ee7ba8c7adb432fdd871a3a09d7a4eae7932b..dc9e2b7f2d36211004d8b8e4a82d9b1ea5c4b3ca 100644 (file)
@@ -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
 
 
 /*