Use HAVE_UTMPX_H rather than HAVE_UTMPX.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1661 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1997-05-04 05:18:32 +00:00
parent 44d39db09e
commit 86cab80d92

View File

@@ -53,13 +53,13 @@ RCSID("$Id$");
#error NEWINIT not supported #error NEWINIT not supported
#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);
@@ -371,7 +371,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
@@ -1364,14 +1364,12 @@ void start_login(char *host, int autologin, char *name)
struct arg_val argv; struct arg_val argv;
struct timeval tmp; struct timeval tmp;
#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();
struct utmpx utmpx; struct utmpx utmpx;
#endif
#ifdef HAVE_UTMPX
/* /*
* Create utmp entry for child * Create utmp entry for child
*/ */
@@ -1616,9 +1614,8 @@ 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 static void
void
rmut(void) rmut(void)
{ {
int f; int f;
@@ -1641,12 +1638,17 @@ rmut(void)
if (utxp) { if (utxp) {
strcpy(utxp->ut_user, ""); strcpy(utxp->ut_user, "");
utxp->ut_type = DEAD_PROCESS; utxp->ut_type = DEAD_PROCESS;
#ifdef __osf__ /* XXX */
utxp->ut_exit.ut_termination = 0;
utxp->ut_exit.ut_exit = 0;
#else
#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;
#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 #endif
gettimeofday(&tmp, NULL); gettimeofday(&tmp, NULL);
utxp->ut_tv.tv_sec = tmp.tv_sec; utxp->ut_tv.tv_sec = tmp.tv_sec;
@@ -1660,9 +1662,8 @@ 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 static void
void
rmut(void) rmut(void)
{ {
int f; int f;
@@ -1718,9 +1719,8 @@ 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 static void
void
rmut (char *line) rmut (char *line)
{ {
struct utmp utmp; struct utmp utmp;
@@ -1822,7 +1822,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 */