From: Will Johansson Date: Mon, 15 Dec 2014 11:51:29 +0000 (-0800) Subject: login: Fix unused variables in login.c if _HAVE_UT_TV isn't defined X-Git-Tag: v2.26-rc1~132 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecc5632f09b15d10bb4031750e4e0abf83a71f6e;p=thirdparty%2Futil-linux.git 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 --- diff --git a/login-utils/login.c b/login-utils/login.c index 540554e77a..f07358fae6 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));