mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
0d197c00b3
commit
3faef98a2a
2 changed files with 8 additions and 2 deletions
|
@ -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.
|
* ext/pty/pty.c (MasterDevice, SlaveDevice, deviceNo): constified.
|
||||||
|
|
||||||
|
|
|
@ -197,7 +197,7 @@ establishShell(argc, argv, info, SlaveName)
|
||||||
char SlaveName[DEVICELEN];
|
char SlaveName[DEVICELEN];
|
||||||
{
|
{
|
||||||
int i,master,slave;
|
int i,master,slave;
|
||||||
char *p,*getenv();
|
char *p, tmp, *getenv();
|
||||||
struct passwd *pwent;
|
struct passwd *pwent;
|
||||||
VALUE v;
|
VALUE v;
|
||||||
struct exec_info arg;
|
struct exec_info arg;
|
||||||
|
@ -270,6 +270,7 @@ establishShell(argc, argv, info, SlaveName)
|
||||||
}
|
}
|
||||||
close(master);
|
close(master);
|
||||||
#endif
|
#endif
|
||||||
|
write(slave, "", 1);
|
||||||
dup2(slave,0);
|
dup2(slave,0);
|
||||||
dup2(slave,1);
|
dup2(slave,1);
|
||||||
dup2(slave,2);
|
dup2(slave,2);
|
||||||
|
@ -285,6 +286,7 @@ establishShell(argc, argv, info, SlaveName)
|
||||||
_exit(1);
|
_exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
read(master, &tmp, 1);
|
||||||
close(slave);
|
close(slave);
|
||||||
|
|
||||||
info->child_pid = i;
|
info->child_pid = i;
|
||||||
|
@ -351,6 +353,7 @@ get_device_once(master, slave, SlaveName, fail)
|
||||||
#if defined I_PUSH && !defined linux
|
#if defined I_PUSH && !defined linux
|
||||||
if(ioctl(j, I_PUSH, "ptem") != -1) {
|
if(ioctl(j, I_PUSH, "ptem") != -1) {
|
||||||
if(ioctl(j, I_PUSH, "ldterm") != -1) {
|
if(ioctl(j, I_PUSH, "ldterm") != -1) {
|
||||||
|
ioctl(j, I_PUSH, "ttcompat");
|
||||||
#endif
|
#endif
|
||||||
*master = i;
|
*master = i;
|
||||||
*slave = j;
|
*slave = j;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue