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>
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));