… | |
… | |
76 | int pfd; |
76 | int pfd; |
77 | |
77 | |
78 | #ifdef PTYS_ARE_OPENPTY |
78 | #ifdef PTYS_ARE_OPENPTY |
79 | char tty_name[sizeof "/dev/pts/????\0"]; |
79 | char tty_name[sizeof "/dev/pts/????\0"]; |
80 | |
80 | |
|
|
81 | rxvt_privileges(RESTORE); |
81 | if (openpty (&pfd, fd_tty, tty_name, NULL, NULL) != -1) |
82 | int res = openpty (&pfd, fd_tty, tty_name, NULL, NULL); |
|
|
83 | rxvt_privileges(IGNORE); |
|
|
84 | |
|
|
85 | if (res != -1) |
82 | { |
86 | { |
83 | *ttydev = strdup (tty_name); |
87 | *ttydev = strdup (tty_name); |
84 | return pfd; |
88 | return pfd; |
85 | } |
89 | } |
86 | #endif |
90 | #endif |
… | |
… | |
400 | |
404 | |
401 | void |
405 | void |
402 | rxvt_ptytty::put () |
406 | rxvt_ptytty::put () |
403 | { |
407 | { |
404 | #ifndef NO_SETOWNER_TTYDEV |
408 | #ifndef NO_SETOWNER_TTYDEV |
405 | if (tty >= 0) |
|
|
406 | privileges (RESTORE); |
409 | privileges (RESTORE); |
407 | #endif |
410 | #endif |
408 | |
411 | |
409 | if (pty >= 0) close (pty); |
412 | if (pty >= 0) close (pty); |
410 | close_tty (); |
413 | close_tty (); |
411 | free (name); |
414 | free (name); |