Don't use a separate function for inquire pty name

ttyname fails in upstream kernels. Although I am still not 100 % sure
why, but I strongly believe it might be because we can't join a mount
namespace yet as well, so the filename in /dev/pts will be meaningless.
The terminal itself work, so this is yet another indicator that this is
just indeed a pathname issue.

Point is, besides only being used for displaying the name and debugging,
the slave name can be acquired at openpty itself, without the need of a
second function call.

I therefore propose we go by this.

[ v2: ttyname is also called to set the terminal name. Move it inside
  openpty. Use PATH_MAX for string size ]

Signed-off-by: Glauber Costa <glommer@parallels.com>
1 file changed