login.c: In function ‘dolastlog’:
login.c:1438 warning: passing argument 1 of ‘time’ from incompatible pointer type
Unfortunately, on-disk lastlog format is always 32bit, bits/utmp.h:
struct lastlog
{
#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
int32_t ll_time;
#else
__time_t ll_time;
#endif
Signed-off-by: Karel Zak <kzak@redhat.com>
lseek(fd, (off_t)pwd->pw_uid * sizeof(ll), SEEK_SET);
}
memset((char *)&ll, 0, sizeof(ll));
- time(&ll.ll_time);
+
+ {
+ time_t t;
+ time(&t);
+ ll.ll_time = t; /* ll_time is always 32bit */
+ }
+
xstrncpy(ll.ll_line, tty_name, sizeof(ll.ll_line));
if (hostname)
xstrncpy(ll.ll_host, hostname, sizeof(ll.ll_host));