* 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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user