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@1481 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1362,7 +1362,7 @@ void start_login(char *host, int autologin, char *name)
|
|||||||
{
|
{
|
||||||
char *cp;
|
char *cp;
|
||||||
struct arg_val argv;
|
struct arg_val argv;
|
||||||
extern char *getenv(const char *);
|
struct timeval tmp;
|
||||||
|
|
||||||
#ifdef HAVE_UTMPX
|
#ifdef HAVE_UTMPX
|
||||||
char id_buf[3];
|
char id_buf[3];
|
||||||
@@ -1384,7 +1384,10 @@ void start_login(char *host, int autologin, char *name)
|
|||||||
SCPYN(utmpx.ut_id, utid);
|
SCPYN(utmpx.ut_id, utid);
|
||||||
|
|
||||||
utmpx.ut_type = LOGIN_PROCESS;
|
utmpx.ut_type = LOGIN_PROCESS;
|
||||||
gettimeofday(&utmpx.ut_tv, NULL);
|
|
||||||
|
gettimeofday (&tmp, NULL);
|
||||||
|
utmpx.ut_tv.tv_sec = tmp.tv_sec;
|
||||||
|
utmpx.ut_tv.tv_usec = tmp.tv_usec;
|
||||||
if (pututxline(&utmpx) == NULL)
|
if (pututxline(&utmpx) == NULL)
|
||||||
fatal(net, "pututxline failed");
|
fatal(net, "pututxline failed");
|
||||||
#endif
|
#endif
|
||||||
@@ -1622,7 +1625,7 @@ rmut(void)
|
|||||||
struct utmp *u, *utmp;
|
struct utmp *u, *utmp;
|
||||||
int nutmp;
|
int nutmp;
|
||||||
struct stat statbf;
|
struct stat statbf;
|
||||||
|
struct timeval tmp;
|
||||||
struct utmpx *utxp, utmpx;
|
struct utmpx *utxp, utmpx;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1644,7 +1647,9 @@ rmut(void)
|
|||||||
utxp->ut_exit.e_termination = 0;
|
utxp->ut_exit.e_termination = 0;
|
||||||
utxp->ut_exit.e_exit = 0;
|
utxp->ut_exit.e_exit = 0;
|
||||||
#endif
|
#endif
|
||||||
gettimeofday(&utxp->ut_tv, NULL);
|
gettimeofday(&tmp, NULL);
|
||||||
|
utxp->ut_tv.tv_sec = tmp.tv_sec;
|
||||||
|
utxp->ut_tv.tv_usec = tmp.tv_usec;
|
||||||
pututxline(utxp);
|
pututxline(utxp);
|
||||||
#ifdef WTMPX_FILE
|
#ifdef WTMPX_FILE
|
||||||
updwtmpx(WTMPX_FILE, utxp);
|
updwtmpx(WTMPX_FILE, utxp);
|
||||||
|
Reference in New Issue
Block a user