--- rxvt-unicode/src/logging.C 2005/01/19 15:20:47 1.12 +++ rxvt-unicode/src/logging.C 2005/02/16 20:32:05 1.14 @@ -44,6 +44,10 @@ #include "logging.h" #ifdef UTMP_SUPPORT +int rxvt_write_bsd_utmp (int utmp_pos, struct utmp *wu); +void rxvt_update_wtmp (const char *fname, const struct utmp *putmp); +void rxvt_update_lastlog (const char *fname, const char *pty, const char *host); + /* * BSD style utmp entry * ut_line, ut_name, ut_host, ut_time @@ -73,17 +77,17 @@ if (!strncmp (pty, "/dev/", 5)) pty += 5; /* skip /dev/ prefix */ - if (!strncmp (pty, "pty", 3) || !strncmp (pty, "tty", 3)) - strncpy (ut_id, (pty + 3), sizeof (ut_id)); #ifdef HAVE_UTMP_PID + if (!strncmp (pty, "pty", 3) || !strncmp (pty, "tty", 3)) + strncpy (ut_id, pty + 3, sizeof (ut_id)); else if (sscanf (pty, "pts/%d", &i) == 1) sprintf (ut_id, "vt%02x", (i & 0xff)); /* sysv naming */ -#endif else if (strncmp (pty, "pty", 3) && strncmp (pty, "tty", 3)) { rxvt_warn ("can't parse tty name \"%s\", not adding utmp entry.\n", pty); return; } +#endif #ifdef HAVE_STRUCT_UTMP memset (ut, 0, sizeof (struct utmp));