summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/util/pty/ChangeLog10
-rw-r--r--src/util/pty/configure.in14
-rw-r--r--src/util/pty/update_utmp.c4
3 files changed, 28 insertions, 0 deletions
diff --git a/src/util/pty/ChangeLog b/src/util/pty/ChangeLog
index 252714063..8816ca86b 100644
--- a/src/util/pty/ChangeLog
+++ b/src/util/pty/ChangeLog
@@ -1,3 +1,13 @@
+Fri Nov 15 08:33:54 1996 Ezra Peisach <epeisach@mit.edu>
+
+ * update_utmp.c (pty_update_utmp): Handle case where utmp uses
+ ut_exit.e_exit and utmpx uses ut_exit.ut_exit.
+
+ * configure.in (UT_EXIT_STRUCTURE_DIFFER): If utmpx.h exists, and
+ getutmpx does not exist then test if the ut_exit part of
+ the utmp/utmpx structure is a structure and if their types
+ differ. (e_exit vs. ut_exit).
+
Fri Nov 8 17:45:42 1996 Theodore Y. Ts'o <tytso@mit.edu>
* update_utmp.c (pty_update_utmp): Add code which attempts to
diff --git a/src/util/pty/configure.in b/src/util/pty/configure.in
index 77d2603c7..2394debbe 100644
--- a/src/util/pty/configure.in
+++ b/src/util/pty/configure.in
@@ -132,6 +132,20 @@ AC_DEFINE(SETPGRP_TWOARG)
fi
dnl
dnl
+if test $ac_cv_header_utmpx_h = yes -a $ac_cv_func_getutmpx = no; then
+AC_MSG_CHECKING([if utmpx and utmp ut_exit structures differ])
+AC_CACHE_VAL(krb5_cv_utmp_utmpx_diff_exit_struct,
+[AC_TRY_COMPILE(
+[#include <sys/types.h>
+#include <utmp.h>
+#include <utmpx.h>],[struct utmpx utx; struct utmp ut;
+utx.ut_exit.ut_exit = ut.ut_exit.e_exit],
+krb5_cv_utmp_utmpx_diff_exit_struct=yes, krb5_cv_utmp_utmpx_diff_exit_struct=no)])
+AC_MSG_RESULT($krb5_cv_utmp_utmpx_diff_exit_struct)
+if test $krb5_cv_utmp_utmpx_diff_exit_struct = yes; then
+AC_DEFINE(UT_EXIT_STRUCTURE_DIFFER)
+fi
+fi
dnl
ADD_DEF(-DKERBEROS)
AC_CONST
diff --git a/src/util/pty/update_utmp.c b/src/util/pty/update_utmp.c
index 4e8a09c09..9effab134 100644
--- a/src/util/pty/update_utmp.c
+++ b/src/util/pty/update_utmp.c
@@ -135,7 +135,11 @@ long pty_update_utmp (process_type, pid, username, line, host, flags)
strncpy(utx.ut_line, ent.ut_line, sizeof(ent.ut_line));
utx.ut_pid = ent.ut_pid;
utx.ut_type = ent.ut_type;
+#ifdef UT_EXIT_STRUCTURE_DIFFER
+ utx.ut_exit.ut_exit = ent.ut_exit.e_exit;
+#else
utx.ut_exit = ent.ut_exit;
+#endif
utx.ut_tv.tv_sec = ent.ut_time;
utx.ut_tv.tv_usec = 0;
#endif