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
This commit is contained in:
@@ -14,6 +14,8 @@ static
|
|||||||
void
|
void
|
||||||
utmpx_update(struct utmpx *ut, char *line, char *user, char *host)
|
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_line, line, sizeof(ut->ut_line));
|
||||||
strncpy(ut->ut_user, user, sizeof(ut->ut_user));
|
strncpy(ut->ut_user, user, sizeof(ut->ut_user));
|
||||||
strncpy(ut->ut_host, host, sizeof(ut->ut_host));
|
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);
|
ut->ut_syslen = sizeof(ut->ut_host);
|
||||||
#endif
|
#endif
|
||||||
ut->ut_type = USER_PROCESS;
|
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);
|
pututxline(ut);
|
||||||
#ifdef WTMPX_FILE
|
#ifdef WTMPX_FILE
|
||||||
updwtmpx(WTMPX_FILE, ut);
|
updwtmpx(WTMPX_FILE, ut);
|
||||||
|
Reference in New Issue
Block a user