… | |
… | |
101 | get_pty_openpty (int *fd_tty, char **ttydev) |
101 | get_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); |
… | |
… | |
406 | rxvt_ptytty_unix::put () |
406 | rxvt_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* |
613 | rxvt_ptytty * |
617 | rxvt_ptytty * |
614 | rxvt_new_ptytty () |
618 | rxvt_new_ptytty () |