From: Austin S. <te...@of...> - 2004-11-29 18:40:15
|
On Tue, Nov 02, 2004 at 10:35:41AM -0800, Eric Feng wrote: > Hi, I am having problem with the following perl program which calls > Expect::spawn() when running in background on Solaris. It got suspended. > <script snipped> > > It works fine on linux (both foreground and background). Is this a perl bug > or solaris bug? Is there a setting/workaround to get it to work in > background on solaris? Any help is appreciated. > It fails for me in IO::Pty::make_slave_controlling_terminal() at line 89: # loose controlling terminal explicitely if (defined TIOCNOTTY) { if (open (\*DEVTTY, "/dev/tty")) { ioctl( \*DEVTTY, TIOCNOTTY, 0 ); # Hangs here. close \*DEVTTY; } } This looks like a solaris bug, sort of. As far as I can tell calling TIOCNOTTY on /dev/tty is pretty well obsoleted. It's not even mentioned in any of the man pages. Changing the top line there to: if (0) { # defined TIOCNOTTY) { worked for me. I'm not sure what a good permanent solution is. It may be TIOCNOTTY is required for some of the older BSD based platforms. Maybe an if($^O ne 'solaris') might be appropriate. Austin |