summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-22 03:38:42 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-22 03:38:42 +0000
commit679e43eccb1f458deac7f8be824e17c98e79bead (patch)
tree851878631baf5e0bdf939b3f16f4b81a0e4b8c48 /ext
parenta18125cfc8a8f535ffb591e35908a5fbb4b32302 (diff)
downloadruby-679e43eccb1f458deac7f8be824e17c98e79bead.tar.gz
* ext/pty/pty.c (establishShell): handshaking before close slave
device. [ruby-talk:263410] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@13220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/pty/pty.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/pty/pty.c b/ext/pty/pty.c
index 8e263790a4..206d4cd131 100644
--- a/ext/pty/pty.c
+++ b/ext/pty/pty.c
@@ -200,7 +200,7 @@ establishShell(argc, argv, info)
struct pty_info *info;
{
int i,master,slave;
- char *p,*getenv();
+ char *p, tmp, *getenv();
struct passwd *pwent;
VALUE v;
struct exec_info arg;
@@ -273,6 +273,7 @@ establishShell(argc, argv, info)
}
close(master);
#endif
+ write(slave, "", 1);
dup2(slave,0);
dup2(slave,1);
dup2(slave,2);
@@ -288,6 +289,7 @@ establishShell(argc, argv, info)
_exit(1);
}
+ read(master, &tmp, 1);
close(slave);
info->child_pid = i;
@@ -353,6 +355,7 @@ get_device_once(master, slave, 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;