josh@hi.UUCP (04/18/87)
The following are some small patches that might help make it work correctly on more machines. The fix to the open command was brought to my attention when on one of the local vax's I had tested this on, the DEVICE /dev/tty had been changed to a file! We couldn't prove it was any of my program(s) but just to be sure... Actually, what made it really strange was that the device was owned by myself. Seems strange since the only way to hurt it would to be for myself to be root but I am wandering from the subject... --Josh Siegel P.S. Before you feed this to patch.. strip my signature. Thanks... --- *** /tmp/,RCSt1014645 Fri Apr 17 22:57:35 1987 --- openpty.c Fri Apr 17 22:57:06 1987 *************** *** 5,11 /* *------------------------------------------------------------------ * Copyright 1987, Josh Siegel - * All rights reserved. * * Josh Siegel (siegel@hc.dspo.gov) * Dept of Electrical and Computer Engineering, --- 5,10 ----- /* *------------------------------------------------------------------ * Copyright 1987, Josh Siegel * * Josh Siegel (siegel@hc.dspo.gov) * Dept of Electrical and Computer Engineering, *************** *** 35,40 #include "netw.h" #include "openpty.h" #include <sys/ioctl.h> _loadtty(cond) --- 34,40 ----- #include "netw.h" #include "openpty.h" + #include <sys/file.h> #include <sys/ioctl.h> _loadtty(cond) *************** *** 83,89 return (proc.pt_pfd); } ! t = open("/dev/tty", 2); if (t >= 0) { ioctl(t, TIOCNOTTY, 0); --- 83,89 ----- return (proc.pt_pfd); } ! t = open("/dev/tty", O_RDWR); if (t >= 0) { ioctl(t, TIOCNOTTY, 0); -- Josh Siegel (siegel@hc.dspo.gov) (505) 277-2497 (Home) I'm a mathematician, not a programmer!