Path: utzoo!attcan!uunet!mcsun!sunic!kth!draken!bg From: bg@draken.nada.kth.se (Bj|rn Gr|nvall) Newsgroups: comp.sys.pyramid Subject: Re: Pyramid xterm (premature file closure?) bug Message-ID: Date: 7 Sep 89 06:48:40 GMT References: Sender: bg@nada.kth.se Followup-To: comp.sys.pyramid Lines: 57 In-reply-to: bob@tyranosaur.cis.ohio-state.edu's message of 5 Sep 89 04:50:56 GMT Sorry if you already read this in comp.windows.x. [...] > This is quite frustrating when running applications like the stock su > or an FTP client, or any other that takes the easy way out and opens > /dev/tty for reading. > > X11R3 xterm on most everything but a Pyramid works correctly in this > respect. X10R4 xterm had exactly the same behavior: correct > everywhere but on a Pyramid. (I had hoped the problem would go away > in X11, but I guess not...) I don't think the problem is in xterm but rather in /dev/tty. Consider the behaviour of the following program when run under an xterm and `inside' a script command. draken-15> cat pyr.bug.c #include main() { char ch; int fd = open("/dev/tty", O_RDWR); if (fd == -1) perror("open failed"); if (write(fd, "foo\n", 4) != 4) perror("write failed\n"); if (read(fd, &ch, 1) != 1) perror("read failed\n"); } draken-16> cc pyr.bug.c draken-17> ./a.out foo read failed : Bad file number <--- Should not happen! draken-18> script Script started, file is typescript draken-1> ./a.out foo <-- Ok! draken-2> exit Script done, file is typescript draken-19> Does anybody know if this is fixed in 4.4c? Bj|rn Gr|nvall (Bjorn Gronvall) Royal Institute of Technology, NADA 100 44 Stockholm Sweden email: bg@nada.kth.se phone: +46-8-7909101 -- /Bj|rn.