*** empty log message ***
authorroot <root>
Tue, 17 Jan 2006 10:14:26 +0000 (10:14 +0000)
committerroot <root>
Tue, 17 Jan 2006 10:14:26 +0000 (10:14 +0000)
MANIFEST
src/Makefile.in
src/logging.C
src/logging.h [deleted file]
src/main.C
src/ptytty.C
src/ptytty.h
src/rxvt.h
src/rxvtlib.h.in

index 6ed3c21..ac6657f 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -77,7 +77,6 @@ src/iom_conf.h
 src/keyboard.C
 src/keyboard.h
 src/logging.C
-src/logging.h
 src/main.C
 src/misc.C
 src/netdisp.C
index fc34832..f42779f 100644 (file)
@@ -195,7 +195,7 @@ keyboard.o: callback.h salloc.h rxvtperl.h hookinc.h rsinc.h keyboard.h
 keyboard.o: command.h
 logging.o: ../config.h rxvt.h rxvtlib.h ptytty.h feature.h optinc.h
 logging.o: encoding.h rxvtfont.h rxvtutil.h rxvttoolkit.h iom.h iom_conf.h
-logging.o: callback.h salloc.h rxvtperl.h hookinc.h rsinc.h logging.h
+logging.o: callback.h salloc.h rxvtperl.h hookinc.h rsinc.h
 main.o: ../config.h rxvt.h rxvtlib.h ptytty.h feature.h optinc.h encoding.h
 main.o: rxvtfont.h rxvtutil.h rxvttoolkit.h iom.h iom_conf.h callback.h
 main.o: salloc.h rxvtperl.h hookinc.h rsinc.h keyboard.h
@@ -290,7 +290,7 @@ keyboard.lo: callback.h salloc.h rxvtperl.h hookinc.h rsinc.h keyboard.h
 keyboard.lo: command.h
 logging.lo: ../config.h rxvt.h rxvtlib.h ptytty.h feature.h optinc.h
 logging.lo: encoding.h rxvtfont.h rxvtutil.h rxvttoolkit.h iom.h iom_conf.h
-logging.lo: callback.h salloc.h rxvtperl.h hookinc.h rsinc.h logging.h
+logging.lo: callback.h salloc.h rxvtperl.h hookinc.h rsinc.h
 main.lo: ../config.h rxvt.h rxvtlib.h ptytty.h feature.h optinc.h encoding.h
 main.lo: rxvtfont.h rxvtutil.h rxvttoolkit.h iom.h iom_conf.h callback.h
 main.lo: salloc.h rxvtperl.h hookinc.h rsinc.h keyboard.h
index 4c0fd9a..733884c 100644 (file)
@@ -59,11 +59,14 @@ static void             rxvt_update_lastlog              (const char *fname, con
 void
 rxvt_ptytty::login (int cmd_pid, bool login_shell, const char *hostname)
 {
+  const char *pty = name;
+
+  if (!pty || !*pty)
+    return;
+
   this->cmd_pid     = cmd_pid;
   this->login_shell = login_shell;
 
-  const char *pty = name;
-
 #ifdef HAVE_STRUCT_UTMP
   struct utmp *ut = &this->ut;
 #endif
@@ -226,6 +229,9 @@ rxvt_ptytty::login (int cmd_pid, bool login_shell, const char *hostname)
 void
 rxvt_ptytty::logout ()
 {
+  if (!cmd_pid)
+    return;
+
 #ifdef HAVE_STRUCT_UTMP
   struct utmp *tmput, *ut = &this->ut;
 #endif
@@ -305,6 +311,8 @@ rxvt_ptytty::logout ()
     pututxline (utx);
   endutxent ();
 #endif
+
+  cmd_pid = 0;
 }
 
 /* ------------------------------------------------------------------------- */
diff --git a/src/logging.h b/src/logging.h
deleted file mode 100644 (file)
index 7bb9ebd..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef LOGGING_H_
-#define LOGGING_H_
-
-#ifdef UTMP_SUPPORT
-# if !defined(RXVT_UTMPX_FILE) || !defined(HAVE_STRUCT_UTMPX)
-#  undef HAVE_UTMPX_H
-#  undef HAVE_STRUCT_UTMPX
-# endif
-# if !defined(RXVT_UTMP_FILE) || !defined(HAVE_STRUCT_UTMP)
-#  undef HAVE_UTMP_H
-#  undef HAVE_STRUCT_UTMP
-# endif
-
-# ifdef HAVE_UTMPX_H
-#  include <utmpx.h>
-# endif
-# ifdef HAVE_UTMP_H
-#  include <utmp.h>
-# endif
-
-# if ! defined(HAVE_STRUCT_UTMPX) && ! defined(HAVE_STRUCT_UTMP)
-#  error cannot build with utmp support - no utmp or utmpx struct found
-# endif
-
-# ifdef HAVE_LASTLOG_H
-#  include <lastlog.h>
-# endif
-
-# include <pwd.h>
-
-# ifdef RXVT_UTMP_SYSV
-#  ifndef USER_PROCESS
-#   define USER_PROCESS                7
-#  endif
-#  ifndef DEAD_PROCESS
-#   define DEAD_PROCESS                8
-#  endif
-# endif
-
-# ifdef __QNX__
-#  include <sys/utsname.h>
-#  define ut_name              ut_user
-# endif
-
-struct rxvt_session
-{
-  int utmp_pos;
-  int cmd_pid;
-  bool login_shell;
-
-#ifdef HAVE_STRUCT_UTMP
-  struct utmp ut;
-#endif
-#ifdef HAVE_STRUCT_UTMPX
-  struct utmpx utx;
-#endif
-#if (defined(HAVE_STRUCT_UTMP) && defined(HAVE_UTMP_PID)) || defined(HAVE_STRUCT_UTMPX)
-  char ut_id[5];
-#endif
-
-  void login (const char *pty, int cmd_pid, bool login_shell, const char *hostname);
-  void logout ();
-};
-
-#endif
-
-#endif /* _LOGGING_H_ */
index 2c9bdd1..9a488f2 100644 (file)
@@ -719,8 +719,7 @@ rxvt_privileges (rxvt_privaction action)
 void
 rxvt_term::privileged_utmp (rxvt_privaction action)
 {
-  if (OPTION (Opt_utmpInhibit)
-      || !pty.name || !*pty.name)
+  if (OPTION (Opt_utmpInhibit))
     return;
 
   rxvt_privileges (RESTORE);
index 6210230..0e27097 100644 (file)
@@ -374,10 +374,14 @@ rxvt_ptytty::rxvt_ptytty ()
 #ifndef NO_SETOWNER_TTYDEV
   saved = false;
 #endif
+#if UTMP_SUPPORT
+  cmd_pid = 0;
+#endif
 }
 
 rxvt_ptytty::~rxvt_ptytty ()
 {
+  logout ();
   put ();
 }
 
index a79ac8b..90dd649 100644 (file)
 # define NO_SETOWNER_TTYDEV 1
 #endif
 
+#if UTMP_SUPPORT
+# if !defined(RXVT_UTMPX_FILE) || !defined(HAVE_STRUCT_UTMPX)
+#  undef HAVE_UTMPX_H
+#  undef HAVE_STRUCT_UTMPX
+# endif
+# if !defined(RXVT_UTMP_FILE) || !defined(HAVE_STRUCT_UTMP)
+#  undef HAVE_UTMP_H
+#  undef HAVE_STRUCT_UTMP
+# endif
+
+# ifdef HAVE_UTMPX_H
+#  include <utmpx.h>
+# endif
+# ifdef HAVE_UTMP_H
+#  include <utmp.h>
+# endif
+
+# if ! defined(HAVE_STRUCT_UTMPX) && ! defined(HAVE_STRUCT_UTMP)
+#  error cannot build with utmp support - no utmp or utmpx struct found
+# endif
+
+# ifdef HAVE_LASTLOG_H
+#  include <lastlog.h>
+# endif
+
+# include <pwd.h>
+
+# ifdef RXVT_UTMP_SYSV
+#  ifndef USER_PROCESS
+#   define USER_PROCESS                7
+#  endif
+#  ifndef DEAD_PROCESS
+#   define DEAD_PROCESS                8
+#  endif
+# endif
+
+# ifdef __QNX__
+#  include <sys/utsname.h>
+#  define ut_name              ut_user
+# endif
+
+#endif
+
 enum rxvt_privaction { IGNORE = 'i', SAVE = 's', RESTORE = 'r' };
 
 struct rxvt_ptytty {
@@ -37,6 +80,25 @@ public:
 
   bool make_controlling_tty ();
   void set_utf8_mode (bool on);
+
+#if UTMP_SUPPORT
+  int utmp_pos;
+  int cmd_pid;
+  bool login_shell;
+
+#ifdef HAVE_STRUCT_UTMP
+  struct utmp ut;
+#endif
+#ifdef HAVE_STRUCT_UTMPX
+  struct utmpx utx;
+#endif
+#if (defined(HAVE_STRUCT_UTMP) && defined(HAVE_UTMP_PID)) || defined(HAVE_STRUCT_UTMPX)
+  char ut_id[5];
+#endif
+
+  void login (int cmd_pid, bool login_shell, const char *hostname);
+  void logout ();
+#endif
 };
 
 #endif
index 9736d61..aa12f09 100644 (file)
@@ -1125,7 +1125,6 @@ struct rxvt_term : zero_initialized, rxvt_vars {
   char            cmdbuf_base[CBUFSIZ];
 
   rxvt_ptytty     pty;
-  rxvt_session    session;
 
   rxvt_salloc    *talloc;             // text line allocator
   rxvt_salloc    *ralloc;             // rend line allocator
index 60c3231..0a8bd7f 100644 (file)
@@ -31,7 +31,6 @@
 #endif
 
 #include "ptytty.h"
-#include "logging.h"
 
 extern "C" {
 #include <X11/Intrinsic.h>      /* Xlib, Xutil, Xresource, Xfuncproto */