ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/logging.C
(Generate patch)

Comparing rxvt-unicode/src/logging.C (file contents):
Revision 1.27 by root, Tue Jan 17 10:14:26 2006 UTC vs.
Revision 1.28 by root, Tue Jan 17 10:19:13 2006 UTC

57 * make and write utmp and wtmp entries 57 * make and write utmp and wtmp entries
58 */ 58 */
59void 59void
60rxvt_ptytty::login (int cmd_pid, bool login_shell, const char *hostname) 60rxvt_ptytty::login (int cmd_pid, bool login_shell, const char *hostname)
61{ 61{
62 const char *pty = name;
63
64 if (!pty || !*pty)
65 return;
66
62 this->cmd_pid = cmd_pid; 67 this->cmd_pid = cmd_pid;
63 this->login_shell = login_shell; 68 this->login_shell = login_shell;
64
65 const char *pty = name;
66 69
67#ifdef HAVE_STRUCT_UTMP 70#ifdef HAVE_STRUCT_UTMP
68 struct utmp *ut = &this->ut; 71 struct utmp *ut = &this->ut;
69#endif 72#endif
70#ifdef HAVE_STRUCT_UTMPX 73#ifdef HAVE_STRUCT_UTMPX
224 * remove utmp and wtmp entries 227 * remove utmp and wtmp entries
225 */ 228 */
226void 229void
227rxvt_ptytty::logout () 230rxvt_ptytty::logout ()
228{ 231{
232 if (!cmd_pid)
233 return;
234
229#ifdef HAVE_STRUCT_UTMP 235#ifdef HAVE_STRUCT_UTMP
230 struct utmp *tmput, *ut = &this->ut; 236 struct utmp *tmput, *ut = &this->ut;
231#endif 237#endif
232#ifdef HAVE_STRUCT_UTMPX 238#ifdef HAVE_STRUCT_UTMPX
233 struct utmpx *tmputx, *utx = &this->utx; 239 struct utmpx *tmputx, *utx = &this->utx;
303#ifdef HAVE_STRUCT_UTMPX 309#ifdef HAVE_STRUCT_UTMPX
304 if (utx->ut_pid == cmd_pid) 310 if (utx->ut_pid == cmd_pid)
305 pututxline (utx); 311 pututxline (utx);
306 endutxent (); 312 endutxent ();
307#endif 313#endif
314
315 cmd_pid = 0;
308} 316}
309 317
310/* ------------------------------------------------------------------------- */ 318/* ------------------------------------------------------------------------- */
311/* 319/*
312 * Write a BSD style utmp entry 320 * Write a BSD style utmp entry

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines