* [PATCH] login-utils: Fix unused variables in login.c if _HAVE_UT_TV isn't defined
@ 2014-12-15 11:51 Will Johansson
2014-12-18 10:02 ` Karel Zak
0 siblings, 1 reply; 2+ messages in thread
From: Will Johansson @ 2014-12-15 11:51 UTC (permalink / raw)
To: util-linux; +Cc: Will Johansson
Wrap around the variable declaration for `tv' with ifdef so the compilers
don't warn about unused variables if we're compiling without UT_TV. This
happens with the musl libc, since it doesn't define _HAVE_UT_TV, even
though it _does_ have the ut_tv field in the utmp struct.
Signed-off-by: Will Johansson <will.johansson@gmail.com>
---
login-utils/login.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/login-utils/login.c b/login-utils/login.c
index 540554e..f07358f 100644
--- a/login-utils/login.c
+++ b/login-utils/login.c
@@ -429,7 +429,9 @@ static void init_tty(struct login_context *cxt)
static void log_btmp(struct login_context *cxt)
{
struct utmp ut;
+#if defined(_HAVE_UT_TV) /* in <utmpbits.h> included by <utmp.h> */
struct timeval tv;
+#endif
memset(&ut, 0, sizeof(ut));
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-12-18 10:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-15 11:51 [PATCH] login-utils: Fix unused variables in login.c if _HAVE_UT_TV isn't defined Will Johansson
2014-12-18 10:02 ` Karel Zak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox