login-utils: Fix unused variables in login.c if _HAVE_UT_TV isn't defined
PATCH 1/1 login-utils: 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 <[email protected]>
--- login-utils/login.c | 2 ++ 1 file changed, 2 insertions(+)
login-utils/login.c +2 -0
@@ -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));
Signature · 1 line
1.8.3.1
Quoted 2 lines · Will Johansson
login-utils/login.c | 2 ++ 1 file changed, 2 insertions(+)
Applied, thanks.
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com