From 82578d77f2a00d4794f4e55ae04f431340bbcada Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 16 Jun 2018 05:16:25 +0000 Subject: Small bugfixes and GNU extensions --- src/include/utmps/utmpx.h | 10 ++++++++-- src/utmps/utmps-utmpd.c | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/include/utmps/utmpx.h b/src/include/utmps/utmpx.h index 450d54a..8f6aaa6 100644 --- a/src/include/utmps/utmpx.h +++ b/src/include/utmps/utmpx.h @@ -40,8 +40,6 @@ struct utmpx char _dummy[20] ; } ; -#define ut_name ut_user - #define EMPTY 0 #define BOOT_TIME 2 #define OLD_TIME 4 @@ -72,6 +70,14 @@ extern void logwtmp (char const *, char const *, char const *) ; /* Unused, but some packages require this macro to be present */ #define UTMPX_FILE "/run/utmps/utmp" +/* More old GNU/crap compatibility */ +#define ut_name ut_user +#define ut_xtime ut_tv.tv_sec +#define ut_addr ut_addr_v6[0] +#ifndef _NO_UT_TIME +# define ut_time ut_tv.tv_sec +#endif + #ifdef __cplusplus } #endif diff --git a/src/utmps/utmps-utmpd.c b/src/utmps/utmps-utmpd.c index ecf8215..32d174b 100644 --- a/src/utmps/utmps-utmpd.c +++ b/src/utmps/utmps-utmpd.c @@ -160,7 +160,7 @@ static void do_putline (uid_t uid) utmps_utmpx_unpack(tmp, &b) ; if (idmatch(u.ut_type, u.ut_id, &b)) break ; } - if (lseek(fd, -sizeof(struct utmpx), SEEK_CUR) < 0) + if (lseek(fd, -(off_t)sizeof(struct utmpx), SEEK_CUR) < 0) { answer(errno) ; return ; -- cgit 1.4.1