diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-07 05:58:41 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-07 05:58:41 +0000 |
commit | 3faef98a2a38b9924b9ae606a80ab17e1d4d3d38 (patch) | |
tree | e2acfa6aead71981ef04cafc75b41380f68c06e7 /ext/pty | |
parent | 0d197c00b3fce8b3e3ea25760c5b6bc3064e057d (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@12899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/pty')
-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 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; |