summaryrefslogtreecommitdiffstats
path: root/login-utils/login.c
diff options
context:
space:
mode:
authorWill Johansson2014-12-15 12:51:29 +0100
committerKarel Zak2014-12-18 11:02:08 +0100
commitecc5632f09b15d10bb4031750e4e0abf83a71f6e (patch)
tree4fb62309072c9b299b993c04da7e0a66ba119f6f /login-utils/login.c
parentlibmount: allow unspecified source on remount (diff)
downloadkernel-qcow2-util-linux-ecc5632f09b15d10bb4031750e4e0abf83a71f6e.tar.gz
kernel-qcow2-util-linux-ecc5632f09b15d10bb4031750e4e0abf83a71f6e.tar.xz
kernel-qcow2-util-linux-ecc5632f09b15d10bb4031750e4e0abf83a71f6e.zip
login: Fix unused variables in login.c if _HAVE_UT_TV isn't defined
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>
Diffstat (limited to 'login-utils/login.c')
-rw-r--r--login-utils/login.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/login-utils/login.c b/login-utils/login.c
index 540554e77..f07358fae 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));