From: nobu@... Date: 2006-04-11T22:52:03+09:00 Subject: Re: Strange problem with PTY.spawn() Hi, At Tue, 11 Apr 2006 00:22:42 +0900, Reto Schuettel wrote in [ruby-talk:188393]: > > I've attached the output of truss. Please let me know if more > > information is needed. > > *grmbl* and here it is ... :/ (I hope the ML doesn't reject mails with > attachements). Seems grantpt() failed. Can't you try with this patch? Index: ext/pty/pty.c =================================================================== RCS file: /cvs/ruby/src/ruby/ext/pty/pty.c,v retrieving revision 1.19.2.3 diff -p -U2 -r1.19.2.3 pty.c --- ext/pty/pty.c 8 Sep 2005 05:59:40 -0000 1.19.2.3 +++ ext/pty/pty.c 11 Apr 2006 13:51:09 -0000 @@ -350,4 +350,5 @@ getDevice(master,slave) if((i = open("/dev/ptmx", O_RDWR, 0)) != -1) { + int e; s = signal(SIGCHLD, SIG_DFL); if(grantpt(i) != -1) { @@ -372,7 +373,9 @@ getDevice(master,slave) } } + e = errno; close(i); + errno = e; } - rb_raise(rb_eRuntimeError, "can't get Master/Slave device"); + rb_sys_fail("can't get Master/Slave device"); #else char **p; -- Nobu Nakada