summaryrefslogtreecommitdiffstats
path: root/ext/pty
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-07 05:58:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-07 05:58:41 +0000
commit7c4b06be1390885e5cef2c9fb3b2764de386a45c (patch)
treef1a811d8b561dda7b64c76228d70dde4c6cbf9f9 /ext/pty
parent46128d27d2729ce23f8ab780c4ed9201736b729f (diff)
downloadruby-7c4b06be1390885e5cef2c9fb3b2764de386a45c.tar.gz
ruby-7c4b06be1390885e5cef2c9fb3b2764de386a45c.tar.xz
ruby-7c4b06be1390885e5cef2c9fb3b2764de386a45c.zip
* ext/pty/pty.c (establishShell): handshaking before close slave
device. [ruby-talk:263410] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/pty')
-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 1d5e15e87..027ca7d5a 100644
--- a/ext/pty/pty.c
+++ b/ext/pty/pty.c
@@ -191,7 +191,7 @@ establishShell(int argc, VALUE *argv, struct pty_info *info,
{
int master,slave;
rb_pid_t pid;
- char *p,*getenv();
+ char *p, tmp, *getenv();
struct passwd *pwent;
VALUE v;
struct exec_info arg;
@@ -264,6 +264,7 @@ establishShell(int argc, VALUE *argv, struct pty_info *info,
}
close(master);
#endif
+ write(slave, "", 1);
dup2(slave,0);
dup2(slave,1);
dup2(slave,2);
@@ -279,6 +280,7 @@ establishShell(int argc, VALUE *argv, struct pty_info *info,
_exit(1);
}
+ read(master, &tmp, 1);
close(slave);
info->child_pid = pid;
@@ -342,6 +344,7 @@ get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int 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;