… | … | ||
---|---|---|---|
104 | static int | 104 | static int |
105 | get_pty (int *fd_tty, char **ttydev) | 105 | get_pty (int *fd_tty, char **ttydev) |
106 | { | 106 | { |
107 | int pfd; | 107 | int pfd; |
108 | int res; | 108 | int res; |
109 | char tty_name[32]; | ||
110 | 109 | ||
111 | res = openpty (&pfd, fd_tty, tty_name, NULL, NULL); | 110 | res = openpty (&pfd, fd_tty, NULL, NULL, NULL); |
112 | 111 | ||
113 | if (res != -1) | 112 | if (res != -1) |
114 | { | 113 | { |
115 | *ttydev = strdup (tty_name); | 114 | *ttydev = strdup (ttyname (*fd_tty)); |
116 | return pfd; | 115 | return pfd; |
117 | } | 116 | } |
118 | 117 | ||
119 | return -1; | 118 | return -1; |
120 | } | 119 | } |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |