lobase

Linux port of OpenBSDs userland.
Log | Files | Refs | README

commit 8ed1fc52aa5d0d346ca43e032b305a2c8bc7c0d2
parent 57df3f61a64a29ae8bbbaa3323e391b34c62f2c4
Author: Duncaen <mail@duncano.de>
Date:   Tue,  7 Mar 2017 17:37:27 +0100

lib/libutil: use ut_tv.tv_sec instead of ut_time in logwtmp on linux

Diffstat:
lib/libutil/logwtmp.c | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/lib/libutil/logwtmp.c b/lib/libutil/logwtmp.c @@ -52,7 +52,11 @@ logwtmp(const char *line, const char *name, const char *host) (void) strncpy(ut.ut_line, line, sizeof(ut.ut_line)); (void) strncpy(ut.ut_name, name, sizeof(ut.ut_name)); (void) strncpy(ut.ut_host, host, sizeof(ut.ut_host)); +#ifdef __linux + (void) time((time_t *)&ut.ut_tv.tv_sec); +#else (void) time(&ut.ut_time); +#endif if (write(fd, &ut, sizeof(struct utmp)) != sizeof(struct utmp)) (void) ftruncate(fd, buf.st_size);