HAVE_UTMPX -> HAVE_UTMPX_H. Fix for OSF1. Some cleanup.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1713 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -39,13 +39,13 @@ RCSID("$Id$");
|
|||||||
# define PARENT_DOES_UTMP
|
# define PARENT_DOES_UTMP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_UTMPX
|
#ifdef HAVE_UTMPX_H
|
||||||
#include <utmpx.h>
|
#include <utmpx.h>
|
||||||
struct utmpx wtmp;
|
struct utmpx wtmp;
|
||||||
#else
|
#else
|
||||||
#include <utmp.h>
|
#include <utmp.h>
|
||||||
struct utmp wtmp;
|
struct utmp wtmp;
|
||||||
#endif /* HAVE_UTMPX */
|
#endif /* HAVE_UTMPX_H */
|
||||||
|
|
||||||
#ifdef HAVE_UT_HOST
|
#ifdef HAVE_UT_HOST
|
||||||
int utmp_len = sizeof(wtmp.ut_host);
|
int utmp_len = sizeof(wtmp.ut_host);
|
||||||
@@ -348,7 +348,7 @@ static char *ptsname(int fd)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_UTMPX
|
#ifdef HAVE_UTMPX_H
|
||||||
static char utid[32]; /* XXX larger than ut_id */
|
static char utid[32]; /* XXX larger than ut_id */
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -1217,7 +1217,7 @@ void start_login(char *host, int autologin, char *name)
|
|||||||
{
|
{
|
||||||
struct arg_val argv;
|
struct arg_val argv;
|
||||||
|
|
||||||
#ifdef HAVE_UTMPX
|
#ifdef HAVE_UTMPX_H
|
||||||
char id_buf[3];
|
char id_buf[3];
|
||||||
int ptynum;
|
int ptynum;
|
||||||
int pid = getpid();
|
int pid = getpid();
|
||||||
@@ -1237,9 +1237,7 @@ void start_login(char *host, int autologin, char *name)
|
|||||||
|
|
||||||
utmpx.ut_type = LOGIN_PROCESS;
|
utmpx.ut_type = LOGIN_PROCESS;
|
||||||
|
|
||||||
gettimeofday (&tmp, NULL);
|
gettimeofday (&utmpx.ut_tv, 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
|
||||||
@@ -1340,7 +1338,7 @@ static int addarg(struct arg_val *argv, char *val)
|
|||||||
* remove the utmp entry for this person.
|
* remove the utmp entry for this person.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_UTMPX
|
#ifdef HAVE_UTMPX_H
|
||||||
static void
|
static void
|
||||||
rmut(void)
|
rmut(void)
|
||||||
{
|
{
|
||||||
@@ -1367,13 +1365,14 @@ rmut(void)
|
|||||||
#ifdef _STRUCT___EXIT_STATUS
|
#ifdef _STRUCT___EXIT_STATUS
|
||||||
utxp->ut_exit.__e_termination = 0;
|
utxp->ut_exit.__e_termination = 0;
|
||||||
utxp->ut_exit.__e_exit = 0;
|
utxp->ut_exit.__e_exit = 0;
|
||||||
|
#elif defined(__osf__) /* XXX */
|
||||||
|
utxp->ut_exit.ut_termination = 0;
|
||||||
|
utxp->ut_exit.ut_exit = 0;
|
||||||
#else
|
#else
|
||||||
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(&tmp, NULL);
|
gettimeofday(&utxp->ut_tv, 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);
|
||||||
@@ -1383,7 +1382,7 @@ rmut(void)
|
|||||||
} /* end of rmut */
|
} /* end of rmut */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(HAVE_UTMPX) && !(defined(_CRAY) || defined(__hpux)) && BSD <= 43
|
#if !defined(HAVE_UTMPX_H) && !(defined(_CRAY) || defined(__hpux)) && BSD <= 43
|
||||||
static void
|
static void
|
||||||
rmut(void)
|
rmut(void)
|
||||||
{
|
{
|
||||||
@@ -1440,7 +1439,7 @@ rmut(void)
|
|||||||
} /* end of rmut */
|
} /* end of rmut */
|
||||||
#endif /* CRAY */
|
#endif /* CRAY */
|
||||||
|
|
||||||
#if defined(__hpux) && !defined(HAVE_UTMPX)
|
#if defined(__hpux) && !defined(HAVE_UTMPX_H)
|
||||||
static void
|
static void
|
||||||
rmut (char *line)
|
rmut (char *line)
|
||||||
{
|
{
|
||||||
@@ -1543,7 +1542,7 @@ cleanup(int sig)
|
|||||||
void
|
void
|
||||||
cleanup(int sig)
|
cleanup(int sig)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_UTMPX) || !defined(HAVE_LOGWTMP)
|
#if defined(HAVE_UTMPX_H) || !defined(HAVE_LOGWTMP)
|
||||||
rmut();
|
rmut();
|
||||||
#ifdef HAVE_VHANGUP
|
#ifdef HAVE_VHANGUP
|
||||||
vhangup(); /* XXX */
|
vhangup(); /* XXX */
|
||||||
|
Reference in New Issue
Block a user