diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-15 23:41:13 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-15 23:41:13 +0000 |
commit | d0fba5f32c3aae53dfbb7a15eac6ba795a86f5da (patch) | |
tree | facce2e77f8fa2c1e254cc03743fe4d7cbf9d30b /ext | |
parent | 7aee73b25716e1bc66774e3debc9170055fe8ada (diff) |
* 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_5@13053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/pty/pty.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/pty/pty.c b/ext/pty/pty.c index 626898ae76..93fb5c0118 100644 --- a/ext/pty/pty.c +++ b/ext/pty/pty.c @@ -197,7 +197,7 @@ establishShell(argc, argv, info) struct pty_info *info; { static int i,master,slave,currentPid; - 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; @@ -354,6 +356,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; |