[8894] in Athena Bugs
(VS3100) Version 7.3P: emacs-18.57 stumbles on missing ptypf
daemon@ATHENA.MIT.EDU ("Mark W. Eichin")
Tue Jan 28 22:30:23 1992
Date: Tue, 28 Jan 92 22:30:07 -0500
From: eichin@Athena.MIT.EDU ("Mark W. Eichin")
To: bugs@Athena.MIT.EDU
System type, version: (VS3100) Version 7.3P
System name: tsx-11
What's wrong:
When the first 14 pty's are in use on a machine with a head (ie. one
which has /dev/ptyv0 (21,15) instead of /dev/ptypf) emacs will fail to
find any of the later ones. It would look at /dev/ptyq... up to ptyzf,
except for the following code:
/mit/emacs/emacs-18.57/src/process.c, 420:
if (stat (pty_name, &stb) < 0)
return -1;
If the stat fails, allocate_pty gives up altogether rather than
continuing for the next name (and thus sub processes get pipes instead
of pty's which can have detrimental effects.)
What should have happened:
If the stat fails, the loop should continue; either there is a missing
pty, or we've *really* run out (if we have, a few extra stats aren't
going to matter since we'll be printing an error message anyhow.) Note
that rlogind only stats /dev/pty?0, assuming that if the zeroeth one
is there it can avoid stat'ing the rest and merely open them directly,
so it works in this instance; perhaps the same change could be made to
emacs.
Another possibility is to assign a completely different number
to /dev/ptypf (or ptyv0) so that there isn't a gap in the sequence,
but I don't know the consequences of that.
_Mark_ <eichin@athena.mit.edu>
MIT Student Information Processing Board