jaco has asked for the wisdom of the Perl Monks concerning the following question:

i'm running into a bit of an issue with this little chunk of code.
open($fhname, "+<$devname") || die "cannot open serial device $dev +name $!\n"; $device->{fd} = fileno($fhname); select((select($fhname), $| = 1)[0]); print STDOUT "it got selected\n"; $fd = fileno($fhname); $tio = new POSIX::Termios; $tio->setispeed(B38400); $tio->setospeed(B38400); $tio->setiflag(IGNBRK|IGNPAR); $tio->setoflag(0); $tio->setlflag(0); $tio->setcflag(CS8|CLOCAL|CREAD|B38400); for (0 .. 16) { $tio->setcc($_, 0); } $tio->setcc(VMIN, 1); $tio->setcc(VTIME, 1); $tio->setattr($fd) || warn "Can't set attributes on $devname: $!\n +";
the problem arrises when moving it to one specific machine. it works flawlessly on all but one. the version of perl is slightly different (rpm packs 5.6.0-12, *-17). works on 12 not 17.

strace keeps hanging on the open

open("/dev/modem", O_RDWR
(hangs til TERM)

any ideas?

Replies are listed 'Best First'.
Re: tty hangs on open
by Anonymous Monk on Feb 13, 2002 at 04:15 UTC
Re: tty hangs on open
by jaco (Pilgrim) on Feb 13, 2002 at 06:33 UTC
    actually this had nothing to do with any of the man pages, nor the way the file was opened. but thanks for the offer.

    turns out something, and i'm not quite sure what was stuck on the port, but probing it clears it out and allows it to open normally