GLIBC made the choice that ut_tv should be shared between 32 and 64

bit platforms so now we can no longer use struct timeval functions to
compare or set/get data that uses pointer (gettimeofday for example)
since ut_tv is now not a struct timeval but rather a struct { int32_t
tv_sec; int32_t tv_usec; };


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21518 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2007-07-12 13:04:50 +00:00
parent 559b419958
commit 578a6f5594

View File

@@ -1276,6 +1276,7 @@ start_login(const char *host, int autologin, char *name)
{
int pid = getpid();
struct utmpx utmpx;
struct timeval tv;
char *clean_tty;
/*
@@ -1293,7 +1294,10 @@ start_login(const char *host, int autologin, char *name)
utmpx.ut_type = LOGIN_PROCESS;
gettimeofday (&utmpx.ut_tv, NULL);
gettimeofday (&tv, NULL);
utmpx.ut_tv.tv_sec = tv.tv_sec;
utmpx.ut_tv.tv_usec = tv.tv_usec;
if (pututxline(&utmpx) == NULL)
fatal(net, "pututxline failed");
}
@@ -1414,6 +1418,7 @@ rmut(void)
non_save_utxp = getutxline(&utmpx);
if (non_save_utxp) {
struct utmpx *utxp;
struct timeval tv;
char user0;
utxp = malloc(sizeof(struct utmpx));
@@ -1434,6 +1439,10 @@ rmut(void)
#endif
#endif
gettimeofday(&utxp->ut_tv, NULL);
gettimeofday (&tv, NULL);
utxp->ut_tv.tv_sec = tv.tv_sec;
utxp->ut_tv.tv_usec = tv.tv_usec;
pututxline(utxp);
#ifdef WTMPX_FILE
utxp->ut_user[0] = user0;