]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
* update_utmp.c (pty_update_utmp): Handle case where utmp uses
authorEzra Peisach <epeisach@mit.edu>
Fri, 15 Nov 1996 13:40:31 +0000 (13:40 +0000)
committerEzra Peisach <epeisach@mit.edu>
Fri, 15 Nov 1996 13:40:31 +0000 (13:40 +0000)
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).

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9422 dc483132-0cff-0310-8789-dd5450dbe970

src/util/pty/ChangeLog
src/util/pty/configure.in
src/util/pty/update_utmp.c

index 252714063857086cbe71760b03966dae7b103f4b..8816ca86ba7cb8f5eb1ee6203ea807450970d7b1 100644 (file)
@@ -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
index 77d2603c7104a36884577f394ba77229ed7e6ecb..2394debbe0e2fd43e906c3f69e1eb793010a3093 100644 (file)
@@ -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
index 4e8a09c090d057093828a2b1238e97048256e7bc..9effab134744151e9cb564e67054d4f191c150ed 100644 (file)
@@ -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