summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ext/pty/pty.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 4331690045..03422e6992 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
-Tue Aug 7 14:56:50 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Aug 7 14:58:39 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/pty/pty.c (establishShell): handshaking before close slave
+ device. [ruby-talk:263410]
* ext/pty/pty.c (MasterDevice, SlaveDevice, deviceNo): constified.
diff --git a/ext/pty/pty.c b/ext/pty/pty.c
index 65b892d174..92e7c3b349 100644
--- a/ext/pty/pty.c
+++ b/ext/pty/pty.c
@@ -197,7 +197,7 @@ establishShell(argc, argv, info, SlaveName)
char SlaveName[DEVICELEN];
{
int i,master,slave;
- char *p,*getenv();
+ char *p, tmp, *getenv();
struct passwd *pwent;
VALUE v;
struct exec_info arg;
@@ -270,6 +270,7 @@ establishShell(argc, argv, info, SlaveName)
}
close(master);
#endif
+ write(slave, "", 1);
dup2(slave,0);
dup2(slave,1);
dup2(slave,2);
@@ -285,6 +286,7 @@ establishShell(argc, argv, info, SlaveName)
_exit(1);
}
+ read(master, &tmp, 1);
close(slave);
info->child_pid = i;
@@ -351,6 +353,7 @@ get_device_once(master, slave, SlaveName, fail)
#if defined I_PUSH && !defined linux
if(ioctl(j, I_PUSH, "ptem") != -1) {
if(ioctl(j, I_PUSH, "ldterm") != -1) {
+ ioctl(j, I_PUSH, "ttcompat");
#endif
*master = i;
*slave = j;