--- rxvt-unicode/src/logging.C 2006/01/17 11:02:10 1.30 +++ rxvt-unicode/src/logging.C 2006/01/22 00:36:59 1.35 @@ -165,14 +165,19 @@ #endif #if defined(HAVE_STRUCT_UTMP) && !defined(HAVE_UTMP_PID) - { # ifdef HAVE_TTYSLOT + int fdstdin = dup (STDIN_FILENO); + dup2 (tty, STDIN_FILENO); + i = ttyslot (); if (rxvt_write_bsd_utmp (i, ut)) utmp_pos = i; + + dup2 (fdstdin, STDIN_FILENO); + close (fdstdin); # else - FILE *fd0; + FILE *fd0; if ((fd0 = fopen (TTYTAB_FILENAME, "r")) != NULL) { @@ -200,9 +205,9 @@ #endif #ifdef WTMP_SUPPORT -# ifdef WTMP_ONLY_ON_LOGIN +#ifdef LOG_ONLY_ON_LOGIN if (login_shell) -# endif +#endif { # ifdef HAVE_STRUCT_UTMP # ifdef HAVE_UPDWTMP @@ -217,7 +222,9 @@ } #endif #if defined(LASTLOG_SUPPORT) && defined(RXVT_LASTLOG_FILE) +#ifdef LOG_ONLY_ON_LOGIN if (login_shell) +#endif rxvt_update_lastlog (RXVT_LASTLOG_FILE, pty, hostname); #endif } @@ -276,9 +283,9 @@ * Write ending wtmp entry */ #ifdef WTMP_SUPPORT -# ifdef WTMP_ONLY_ON_LOGIN +#ifdef LOG_ONLY_ON_LOGIN if (login_shell) -# endif +#endif { # ifdef HAVE_STRUCT_UTMP # ifdef HAVE_UPDWTMP @@ -442,4 +449,9 @@ #endif /* LASTLOG_SUPPORT */ /* ------------------------------------------------------------------------- */ +#else +void +rxvt_ptytty_unix::login (int cmd_pid, bool login_shell, const char *hostname) +{ +} #endif /* UTMP_SUPPORT */