* fhandler.h (__ptsname): New macro.

* dtable.cc (decode_tty): Use __ptsname to generate the slave pty name.
* fhandler_tty.cc (fhandler_pty_master::ptsname_r): Ditto.
* bsdlib.cc: Add needed includes for openpty() changes.
(openpty): Use __ptsname to generate the slave pty name.  Close slave fd when
aslave == NULL.
This commit is contained in:
Christopher Faylor
2011-11-08 06:26:15 +00:00
parent 5d46c490dd
commit 926014453f
5 changed files with 24 additions and 5 deletions

View File

@@ -1424,7 +1424,7 @@ fhandler_pty_master::ptsname_r (char *buf, size_t buflen)
{
char tmpbuf[TTY_NAME_MAX];
__small_sprintf (tmpbuf, "/dev/pty%d", get_unit ());
__ptsname (tmpbuf, get_unit ());
if (buflen <= strlen (tmpbuf))
{
set_errno (ERANGE);