* 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

@@ -1456,6 +1456,7 @@ class fhandler_pty_slave: public fhandler_pty_common
}
};
#define __ptsname(buf, unit) __small_sprintf ((buf), "/dev/pty%d", (unit))
class fhandler_pty_master: public fhandler_pty_common
{
int pktmode; // non-zero if pty in a packet mode.