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