From f8ee9c5377e6c318f6fc4d2a0d822437e7a171fe Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sun, 23 Mar 1997 04:57:06 +0000 Subject: [PATCH] Do gettimeofday and then copy the data for the sake of those systems like SGI that can have different timevals in file and memory. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1474 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/login/utmpx_login.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/appl/login/utmpx_login.c b/appl/login/utmpx_login.c index d1fddc1f0..df1215506 100644 --- a/appl/login/utmpx_login.c +++ b/appl/login/utmpx_login.c @@ -14,6 +14,8 @@ static void utmpx_update(struct utmpx *ut, char *line, char *user, char *host) { + struct timeval tmp; + strncpy(ut->ut_line, line, sizeof(ut->ut_line)); strncpy(ut->ut_user, user, sizeof(ut->ut_user)); strncpy(ut->ut_host, host, sizeof(ut->ut_host)); @@ -23,7 +25,9 @@ utmpx_update(struct utmpx *ut, char *line, char *user, char *host) ut->ut_syslen = sizeof(ut->ut_host); #endif ut->ut_type = USER_PROCESS; - gettimeofday(&(ut->ut_tv), 0); + gettimeofday (&tmp, 0); + ut->ut_tv.tv_sec = tmp.tv_sec; + ut->ut_tv.tv_usec = tmp.tv_usec; pututxline(ut); #ifdef WTMPX_FILE updwtmpx(WTMPX_FILE, ut);