From: Clarissa C. <clc...@ya...> - 2004-01-12 23:08:34
|
Hello, I just installed Expect and IO::Tty, IO::Pty on Solaris 9. When I do the "make test" for IO-Tty, I am given the message "Passed 4 of 4 tests", however, test 2 gives a warning: Checking if child gets pty as controlling terminal... ... trying to I_PUSH ttcompat... Use of uninitalized value in ioctl at /path/to/build/IO-Tty-1.02/blib/lib/IO/Pty.pm line 119 warning: TIOCSCTTY failed, slave might not be set as controlling terminal: Invalid argument at /path/to/build/IO-Tty-1.02/blib/lib/IO/Pty.pm line 120. I ignored this since it "Passed 4 of 4 tests", but when I wrote my first program: $command=Expect->spawn('/usr/bin/telnet', ('1.2.3.4')); I get the same exact error. I didn't think Solaris used the TIOCSCTTY ioctl (so no wonder that it is unitialized). Am I doing something wrong? If not, is there a work-around? Thanks, Clarissa __________________________________ Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus |
From: Roland G. <RGi...@cp...> - 2004-01-13 09:43:32
|
Clarissa Cook wrote: > Hello, > > I just installed Expect and IO::Tty, IO::Pty on Solaris 9. When I do > the "make test" for IO-Tty, I am given the message "Passed 4 of 4 > tests", however, test 2 gives a warning: > > Checking if child gets pty as controlling terminal... > ... > trying to I_PUSH ttcompat... > Use of uninitalized value in ioctl at > /path/to/build/IO-Tty-1.02/blib/lib/IO/Pty.pm line 119 > warning: TIOCSCTTY failed, slave might not be set as controlling > terminal: Invalid argument at > /path/to/build/IO-Tty-1.02/blib/lib/IO/Pty.pm line 120. This is indeed very very strange, as the ioctl() is wrapped in a if(defined TIOCSCTTY), so this shouldn't be happening. Did the "perl Makefile.PL" report something about TIOCSCTTY? > I ignored this since it "Passed 4 of 4 tests", but when I wrote my > first program: > > $command=Expect->spawn('/usr/bin/telnet', ('1.2.3.4')); > > I get the same exact error. It's actually more of a warning, depends on the application. If you're doing nothing too fancy, it might still work. Ahem, and you DID read the FAQ about using Telnet with Expect?! > I didn't think Solaris used the TIOCSCTTY ioctl (so no wonder that it > is unitialized). Am I doing something wrong? If not, is there a > work-around? Very strange indeed... if TIOCSCTTY were not defined, then you wouldn't get that error message... Roland -- RGi...@cp... |
From: Clarissa C. <clc...@ya...> - 2004-01-14 00:41:50
|
Hi, Thanks for the response. --- Roland Giersig <RGi...@cp...> wrote: > Clarissa Cook wrote: > > I just installed Expect and IO::Tty, IO::Pty on Solaris 9. When I do > > the "make test" for IO-Tty, I am given the message "Passed 4 of 4 > > tests", however, test 2 gives a warning: > > > > Checking if child gets pty as controlling terminal... > > ... > > trying to I_PUSH ttcompat... > > Use of uninitalized value in ioctl at > > /path/to/build/IO-Tty-1.02/blib/lib/IO/Pty.pm line 119 > > warning: TIOCSCTTY failed, slave might not be set as controlling > > terminal: Invalid argument at > > /path/to/build/IO-Tty-1.02/blib/lib/IO/Pty.pm line 120. > > This is indeed very very strange, as the ioctl() is wrapped in a > if(defined TIOCSCTTY), so this shouldn't be happening. Did the > "perl > Makefile.PL" report something about TIOCSCTTY? I thought it strange too. perl Makefile.PL gives a "- TIOCSCTTY" in the "checking which symbols compile OK" section but that is the only mention of TIOCSCTTY (and - TIOCSCTTY makes perfect sense since it ISN'T defined in Solaris). perl Makefile.PL ends with a "Configuration looks good." > > I ignored this since it "Passed 4 of 4 tests", but when I wrote my > > first program: > > > > $command=Expect->spawn('/usr/bin/telnet', ('1.2.3.4')); > > > > I get the same exact error. > > It's actually more of a warning, depends on the application. If > you're > doing nothing too fancy, it might still work. Oops. Yes, I misspoke. Warning, not error. Actually, my last ditch effort to make things work without any warnings being printed out was to just comment out that section of code (lines 118 - 126). Things _seem_ to be working so far. > Ahem, and you DID read the FAQ about using Telnet with Expect?! I assume you are talking about the problem with telnet not necessarily dying. Yes, I read this. I'm converting a script written in 1997 and in hourly continuous use since then from Tcl/Tk Expect to Perl Expect. Since I already had Perl Expect installed, I figured I would try it and see if I see any problems. I'm assuming that since we have had very few errors since 1997, then I won't encounter any with Perl. I'm willing to accept that I am wrong though. > > I didn't think Solaris used the TIOCSCTTY ioctl (so no wonder > that it > > is unitialized). Am I doing something wrong? If not, is there a > > work-around? > > Very strange indeed... if TIOCSCTTY were not defined, then you > wouldn't > get that error message... Well, that's how I read Pty.pm ... I mean "if (defined TIOCSCTTY)" isn't even advanced Perl. Clarissa __________________________________ Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus |
From: Jim C. <jc...@di...> - 2004-01-14 19:26:17
|
Clarissa Cook wrote: > >Well, that's how I read Pty.pm ... I mean "if (defined TIOCSCTTY)" >isn't even advanced Perl. > > just a wag - what happens if you hack it, and strip out 'defined' ? >Clarissa > > > |
From: Clarissa C. <clc...@ya...> - 2004-01-14 20:25:24
|
Hi, --- Jim Cromie <jc...@di...> wrote: > Clarissa Cook wrote: > > > > >Well, that's how I read Pty.pm ... I mean "if (defined TIOCSCTTY)" > >isn't even advanced Perl. > > > > > > just a wag - what happens if you hack it, and strip out 'defined' ? Ooo! Very good point. So, replacing with: if (TIOCSCTTY) { } elsif (TCSETCTTY) { } (note I had to delete the defined on the TCSETCTTY as well), then the warning about TIOCSCTTY and TCSETCTTY go away (but are replaced with "Useless use of a constant in void context at ...") Progress! (of sorts). Thanks, Clarissa __________________________________ Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus |
From: Jim C. <jc...@di...> - 2004-01-14 21:22:44
|
Clarissa Cook wrote: >Hi, > >--- Jim Cromie <jc...@di...> wrote: > > >>Clarissa Cook wrote: >> >> >> >>>Well, that's how I read Pty.pm ... I mean "if (defined TIOCSCTTY)" >>>isn't even advanced Perl. >>> >>> >>> >>> >>just a wag - what happens if you hack it, and strip out 'defined' ? >> >> > >Ooo! Very good point. So, replacing with: >if (TIOCSCTTY) { >} elsif (TCSETCTTY) { >} >(note I had to delete the defined on the TCSETCTTY as well), then the >warning about TIOCSCTTY and TCSETCTTY go away (but are replaced with >"Useless use of a constant in void context at ...") > > Having looked at the code, I take it that ... is elsewhere, ie your user code. >Progress! (of sorts). > > good. now you have to decide what its telling you. Keep in mind that it was a WAG (wild ass guess), and was not intended to imply certainty about 'which way is west'. Id suggest focussing on what WIERD about this. In my limited use of Expect, Ive not encountered problems, except basic user ones. Roland is *highly* qualified in the edge cases of this package. ;-) >Thanks, >Clarissa > > > |