7.4. Why does rn fail with "Can't open /dev/tty" from the built-in modem?
The problem is a line in the term.c file. The lines that have
to be changed for rn to work are:
Before change:
[...]
devtty = open("/dev/tty",O_RDONLY);
if (devtty < 0) {
printf(cantopen,"/dev/tty") FLUSH;
finalize(1);
}
fcntl(devtty,F_SETFL,O_NDELAY);
[...]
After change:
[...]
devtty = open("/dev/tty",O_RDWR); /* changed for UNIX PC */
if (devtty < 0) {
printf(cantopen,"/dev/tty") FLUSH;
finalize(1);
}
/* fcntl(devtty,F_SETFL,O_NDELAY); /* changed for UNIX PC */
[...]
This change is required because the /dev/ph* devices require
DATA connections to be opened with O_RDWR, so changing the O_RDONLY
(or, in some versions of rn, the constant 0) to O_RDWR will solve your
problems. Note that these changes are also required for rn-derived
programs like trn.
Parent document is top of "comp.sys.3b1 FAQ part2"
Previous document is "7.3. What can I do when I get lots of FDERRs when writing/formatting a floppy?"
Next document is "7.5. Can I connect my Starlan board to an Ethernet?"