Fixed bug with systems lacking logwtmp.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@563 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1996-06-07 22:29:32 +00:00
parent 20d9dec654
commit 5d151b2cc1

View File

@@ -1894,36 +1894,13 @@ rmut (char *line)
* clean up anything that needs to be cleaned up.
*/
#ifdef PARENT_DOES_UTMP
void
cleanup(int sig)
{
#ifndef PARENT_DOES_UTMP
#ifndef HAVE_UTMPX_H
/* # if (BSD > 43) || defined(convex) */
char *p;
p = line + sizeof("/dev/") - 1;
if (logout(p))
logwtmp(p, "", "");
(void)chmod(line, 0666);
(void)chown(line, 0, 0);
*p = 'p';
(void)chmod(line, 0666);
(void)chown(line, 0, 0);
(void) shutdown(net, 2);
exit(1);
# else
rmut();
#ifdef HAVE_VHANGUP
vhangup(); /* XXX */
#else
#endif
(void) shutdown(net, 2);
exit(1);
# endif
#else /* PARENT_DOES_UTMP */
# ifdef NEWINIT
(void) shutdown(net, 2);
shutdown(net, 2);
exit(1);
# else /* NEWINIT */
# ifdef CRAY
@@ -1983,9 +1960,38 @@ cleanup(int sig)
# endif /* CRAY */
exit(1);
# endif /* NEWINT */
#endif /* PARENT_DOES_UTMP */
}
#else /* PARENT_DOES_UTMP */
extern void rmut(void);
void
cleanup(int sig)
{
#if defined(HAVE_UTMPX_H) || !defined(HAVE_LOGWTMP)
rmut();
#ifdef HAVE_VHANGUP
vhangup(); /* XXX */
#endif
#else
char *p;
p = line + sizeof("/dev/") - 1;
if (logout(p))
logwtmp(p, "", "");
chmod(line, 0666);
chown(line, 0, 0);
*p = 'p';
chmod(line, 0666);
chown(line, 0, 0);
#endif
shutdown(net, 2);
exit(1);
}
#endif /* PARENT_DOES_UTMP */
#if defined(PARENT_DOES_UTMP) && !defined(NEWINIT)
/*
* _utmp_sig_rcv