… | |
… | |
74 | get_pty (int *fd_tty, char **ttydev) |
74 | get_pty (int *fd_tty, char **ttydev) |
75 | { |
75 | { |
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 |
… | |
… | |
334 | } ttyconf; |
338 | } ttyconf; |
335 | |
339 | |
336 | void |
340 | void |
337 | rxvt_ptytty::privileges (rxvt_privaction action) |
341 | rxvt_ptytty::privileges (rxvt_privaction action) |
338 | { |
342 | { |
339 | if (tty < 0) |
343 | if (pty < 0) |
340 | return; |
344 | return; |
341 | |
345 | |
342 | rxvt_privileges (RESTORE); |
346 | rxvt_privileges (RESTORE); |
343 | |
347 | |
344 | if (action == SAVE) |
348 | if (action == SAVE) |