--- rxvt-unicode/src/logging.C 2006/01/16 10:37:32 1.24 +++ rxvt-unicode/src/logging.C 2006/01/17 09:31:24 1.26 @@ -30,14 +30,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *----------------------------------------------------------------------*/ -/*----------------------------------------------------------------------* - * Public: - * extern void cleanutent (void); - * extern void makeutent (const char * pty, const char * hostname); - * - * Private: - * rxvt_update_wtmp (); - *----------------------------------------------------------------------*/ #include "../config.h" #include "rxvt.h" @@ -65,8 +57,11 @@ * make and write utmp and wtmp entries */ void -rxvt_term::makeutent (const char *pty, const char *hostname) +rxvt_session::login (const char *pty, int cmd_pid, bool login_shell, const char *hostname) { + this->cmd_pid = cmd_pid; + this->login_shell = login_shell; + #ifdef HAVE_STRUCT_UTMP struct utmp *ut = &this->ut; #endif @@ -201,7 +196,7 @@ #ifdef WTMP_SUPPORT # ifdef WTMP_ONLY_ON_LOGIN - if (OPTION (Opt_loginShell)) + if (login_shell) # endif { # ifdef HAVE_STRUCT_UTMP @@ -217,7 +212,7 @@ } #endif #if defined(LASTLOG_SUPPORT) && defined(RXVT_LASTLOG_FILE) - if (OPTION (Opt_loginShell)) + if (login_shell) rxvt_update_lastlog (RXVT_LASTLOG_FILE, pty, hostname); #endif } @@ -227,10 +222,10 @@ * remove utmp and wtmp entries */ void -rxvt_term::cleanutent () +rxvt_session::logout () { #ifdef HAVE_STRUCT_UTMP - struct utmp *ut = &this->ut; + struct utmp *tmput, *ut = &this->ut; #endif #ifdef HAVE_STRUCT_UTMPX struct utmpx *tmputx, *utx = &this->utx; @@ -242,12 +237,8 @@ setutent (); strncpy (ut->ut_id, this->ut_id, sizeof (ut->ut_id)); ut->ut_type = USER_PROCESS; - { - struct utmp *tmput = getutid (ut); - - if (tmput) /* position to entry in utmp file */ - ut = tmput; - } + if ((tmput = getutid (ut))) /* position to entry in utmp file */ + ut = tmput; ut->ut_type = DEAD_PROCESS; # else memset (ut->ut_name, 0, sizeof (ut->ut_name)); @@ -278,7 +269,7 @@ */ #ifdef WTMP_SUPPORT # ifdef WTMP_ONLY_ON_LOGIN - if (OPTION (Opt_loginShell)) + if (login_shell) # endif { # ifdef HAVE_STRUCT_UTMP