summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-02-20 19:06:49 +0100
committerAlejandro Colomar <alx@kernel.org>2024-02-21 18:15:59 +0100
commit261f40423a60b052674f823ea04b9e6c9b514767 (patch)
treed81908adbb990d8fd32f88614e69e9f45c08fadb
parent02a9d041a37edba1af1662f5cb4d695ca41d3f1c (diff)
lib/utmp.c: Indent nested preprocessor conditionals
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com> Signed-off-by: Alejandro Colomar <alx@kernel.org> Cherry-picked-from: f4ea04b72861 ("lib/utmp.c: Indent nested 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.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/utmp.c b/lib/utmp.c
index 7c603e6c..ab2ee7ba 100644
--- a/lib/utmp.c
+++ b/lib/utmp.c
@@ -194,7 +194,7 @@ get_session_host(char **out)
* Some systems already have updwtmpx(). Others
* don't, so we re-implement these functions if necessary.
*/
-#ifndef HAVE_UPDWTMPX
+# ifndef HAVE_UPDWTMPX
static void
updwtmpx(const char *filename, const struct utmpx *ut)
{
@@ -206,7 +206,7 @@ updwtmpx(const char *filename, const struct utmpx *ut)
close (fd);
}
}
-#endif /* ! HAVE_UPDWTMPX */
+# endif /* ! HAVE_UPDWTMPX */
#endif /* ! USE_PAM */
@@ -292,13 +292,13 @@ prepare_utmp(const char *name, const char *line, const char *host,
if (info->ai_family == AF_INET) {
struct sockaddr_in *sa =
(struct sockaddr_in *) info->ai_addr;
-#ifdef HAVE_STRUCT_UTMP_UT_ADDR
+# ifdef HAVE_STRUCT_UTMP_UT_ADDR
memcpy (&(utent->ut_addr),
&(sa->sin_addr),
MIN (sizeof (utent->ut_addr),
sizeof (sa->sin_addr)));
-#endif /* HAVE_STRUCT_UTMP_UT_ADDR */
-#ifdef HAVE_STRUCT_UTMP_UT_ADDR_V6
+# endif /* HAVE_STRUCT_UTMP_UT_ADDR */
+# ifdef HAVE_STRUCT_UTMP_UT_ADDR_V6
memcpy (utent->ut_addr_v6,
&(sa->sin_addr),
MIN (sizeof (utent->ut_addr_v6),
@@ -310,7 +310,7 @@ prepare_utmp(const char *name, const char *line, const char *host,
&(sa->sin6_addr),
MIN (sizeof (utent->ut_addr_v6),
sizeof (sa->sin6_addr)));
-#endif /* HAVE_STRUCT_UTMP_UT_ADDR_V6 */
+# endif /* HAVE_STRUCT_UTMP_UT_ADDR_V6 */
}
freeaddrinfo (info);
}