From ecc5632f09b15d10bb4031750e4e0abf83a71f6e Mon Sep 17 00:00:00 2001 From: Will Johansson Date: Mon, 15 Dec 2014 03:51:29 -0800 Subject: 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 --- login-utils/login.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'login-utils/login.c') 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 included by */ struct timeval tv; +#endif memset(&ut, 0, sizeof(ut)); -- cgit v1.2.3-55-g7522