Xref: utzoo comp.sys.apollo:1600 comp.windows.x:6174 Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!rutgers!ucla-cs!admin.cognet.ucla.edu!casey From: casey@admin.cognet.ucla.edu (Casey Leedom) Newsgroups: comp.sys.apollo,comp.windows.x Subject: Re: X11R3 under Apollo SR10.0 Message-ID: <17957@shemp.CS.UCLA.EDU> Date: 15 Nov 88 22:52:50 GMT References: <17940@shemp.CS.UCLA.EDU> Sender: news@CS.UCLA.EDU Reply-To: casey@cs.ucla.edu (Casey Leedom) Organization: UCLA Cognitive Science Program Lines: 106 | From: dj@dorsai.cognet.ucla.edu (David J. Wells) | | It has become apparent that the patches that Casey posted are not | sufficient to bring a stable X11R3 up under Apollo's SR10.0. One of us | will repost when we are satisfied with what we have. My young and impetuous colleague has no confidence. I don't show up till 1:30pm today and he's already posting about my lack of progress ... :-) But he's right, there are a number of other problems yet to work out. One of the worst is with xterm not properly setting up the tty. What happens is that xterm (started simply via ``xterm &'') gives you a good tty, but doesn't properly detach from the original tty - thus your new pseudo tty isn't your controlling tty. This only leads to problem (that we've discovered so far) when you attempt to access /dev/tty. [The stupid OS allows you to open /dev/tty for R/W, but then gives you a EBADF (bad file descriptor)!!! I wouldn't mind if it choked on the open with an EACCES, or the I/O with a EIO or even a ENXIO, but EBADF when it was the one who gave me that file descriptor??? Talk about your brain damaged error returns ...] In any case, I've added back in some code from the R2 xterm which seems to solve the problem. I've ifdef'ed it on apollo, but it's probably correct for all BSD systems. I don't know why no other system has the same problem. I'd check further, but there are a bunch of other fires I have to get to now ... Casey P.S. I also changed the #ifdef apollo #define ttyslot() 1 #define vhangup() ; #endif /* apollo */ to ``#if defined(apollo) && !defined(_APOLLO_SR10)'' in main.c. I did this in an earlier attempt to fix the problem and haven't bothered pulling it back out (the real fix is further down). This should be cool because SR10 is supposed to be a lot closer to BSD4.3. Thus many of the ifdef's on apollo you may have in your source will probably have to be changed in similar ways. Note also that _APOLLO_SR10 is a define that I added in my previous fixes for the Apollo. ----- *** clients/xterm/main.c-dist Wed Nov 9 13:01:20 1988 --- clients/xterm/main.c Tue Nov 15 14:09:17 1988 *************** *** 96,105 **** #include #endif /* hpux */ ! #ifdef apollo #define ttyslot() 1 #define vhangup() ; ! #endif /* apollo */ #include #include /* for NOFILE */ --- 96,105 ---- #include #endif /* hpux */ ! #if defined(apollo) && !defined(_APOLLO_SR10) #define ttyslot() 1 #define vhangup() ; ! #endif /* apollo && !_APOLLO_SR10 */ #include #include /* for NOFILE */ *************** *** 719,724 **** --- 719,725 ---- term->flags |= AUTOREPEAT; #endif /* DO_AUTOREPEAT */ if (!screen->jumpscroll) term->flags |= SMOOTHSCROLL; + if (term->misc.re_verse) term->flags |= REVERSE_VIDEO; if (term->misc.reverseWrap) term->flags |= REVERSEWRAP; inhibit = 0; *************** *** 1220,1225 **** --- 1221,1240 ---- close (tty); /* tty is no longer an open fd! */ tty = -1; + + #ifdef apollo + /* close all std file descriptors */ + for (index1 = 0; index1 < 3; index1++) + close (index1); + #ifndef SYSV + if ((tty = open ("/dev/tty", O_RDWR, 0)) < 0) + SysError (ERROR_OPDEVTTY2); + + if (ioctl (tty, TIOCNOTTY, (char *) NULL) == -1) + SysError (ERROR_NOTTY); + close (tty); + #endif /* !SYSV */ + #endif /* apollo */ } if (get_pty (&screen->respond)) {