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.49 by ayin, Thu Jan 19 16:40:42 2006 UTC vs.
Revision 1.51 by ayin, Thu Jan 19 18:53:05 2006 UTC

101get_pty_openpty (int *fd_tty, char **ttydev) 101get_pty_openpty (int *fd_tty, char **ttydev)
102{ 102{
103#ifdef PTYS_ARE_OPENPTY 103#ifdef PTYS_ARE_OPENPTY
104 int pfd; 104 int pfd;
105 int res; 105 int res;
106 char tty_name[sizeof "/dev/pts/????\0"]; 106 char tty_name[32];
107 107
108 res = openpty (&pfd, fd_tty, tty_name, NULL, NULL); 108 res = openpty (&pfd, fd_tty, tty_name, NULL, NULL);
109 if (res != -1) 109 if (res != -1)
110 { 110 {
111 *ttydev = strdup (tty_name); 111 *ttydev = strdup (tty_name);
406rxvt_ptytty_unix::put () 406rxvt_ptytty_unix::put ()
407{ 407{
408 chmod (name, RESTORE_TTY_MODE); 408 chmod (name, RESTORE_TTY_MODE);
409 chown (name, 0, ttyconf.gid); 409 chown (name, 0, ttyconf.gid);
410 410
411 if (pty >= 0) close (pty);
412 close_tty (); 411 close_tty ();
412
413 if (pty >= 0)
414 close (pty);
415
413 free (name); 416 free (name);
414 417
415 pty = tty = -1; 418 pty = tty = -1;
416 name = 0; 419 name = 0;
417} 420}
605 608
606 serve (); 609 serve ();
607 _exit (EXIT_SUCCESS); 610 _exit (EXIT_SUCCESS);
608 } 611 }
609} 612}
613
610#endif 614#endif
611 615
612// a "factory" *g* 616// a "factory" *g*
613rxvt_ptytty * 617rxvt_ptytty *
614rxvt_new_ptytty () 618rxvt_new_ptytty ()

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines