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

Comparing rxvt-unicode/src/ptytty.C (file contents):
Revision 1.41 by root, Tue Jan 17 15:41:33 2006 UTC vs.
Revision 1.43 by root, Tue Jan 17 16:50:42 2006 UTC

390#endif 390#endif
391} 391}
392 392
393rxvt_ptytty_unix::~rxvt_ptytty_unix () 393rxvt_ptytty_unix::~rxvt_ptytty_unix ()
394{ 394{
395#if UTMP_SUPPORT
395 logout (); 396 logout ();
397#endif
396 put (); 398 put ();
397} 399}
398 400
399void 401void
400rxvt_ptytty_unix::put () 402rxvt_ptytty_unix::put ()
537 write (sock_fd, &cmd.id, sizeof (cmd.id)); 539 write (sock_fd, &cmd.id, sizeof (cmd.id));
538 } 540 }
539 } 541 }
540 else if (cmd.type == command::login) 542 else if (cmd.type == command::login)
541 { 543 {
544#if UTMP_SUPPORT
542 if (find (ptys.begin (), ptys.end (), cmd.id)) 545 if (find (ptys.begin (), ptys.end (), cmd.id))
543 { 546 {
544 cmd.hostname[sizeof (cmd.hostname) - 1] = 0; 547 cmd.hostname[sizeof (cmd.hostname) - 1] = 0;
545 cmd.id->login (cmd.cmd_pid, cmd.login_shell, cmd.hostname); 548 cmd.id->login (cmd.cmd_pid, cmd.login_shell, cmd.hostname);
546 } 549 }
550#endif
547 } 551 }
548 else if (cmd.type == command::destroy) 552 else if (cmd.type == command::destroy)
549 { 553 {
550 rxvt_ptytty **pty = find (ptys.begin (), ptys.end (), cmd.id); 554 rxvt_ptytty **pty = find (ptys.begin (), ptys.end (), cmd.id);
551 555
552 if (*pty) 556 if (pty)
553 { 557 {
558 delete *pty;
554 ptys.erase (pty); 559 ptys.erase (pty);
555 delete *pty;
556 } 560 }
557 } 561 }
558 else 562 else
559 break; 563 break;
560 } 564 }
590 594
591 // server, pty-helper 595 // server, pty-helper
592 sock_fd = sv[1]; 596 sock_fd = sv[1];
593 597
594 for (int fd = 0; fd < 1023; fd++) 598 for (int fd = 0; fd < 1023; fd++)
595 if (fd != sock_fd) 599 if (fd != sock_fd && fd != 1)
596 close (fd); 600 close (fd);
597 601
598 serve (); 602 serve ();
599 _exit (EXIT_SUCCESS); 603 _exit (EXIT_SUCCESS);
600 } 604 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines