xfree86 3.1.2Cb - 1996/2/10 - T.Dickey (dickey@clark.net) This patch fixes the remaining problems that I had making xterm run with x11r5, as well as a couple of other bugs. It follows my patch from yesterday, that added ifdef's for some of the input-method resources. + corrected ifdef's that suppress the input-method code (doesn't exist in my x11r5, and xterm works adequately without it). + corrected fallback definition for 'Select()' macro (oops: I'd copied the wrong text...) + moved the declarations for the fd_set variables to data.[ch] + corrected an ifdef in resize.c (sunos 4.x doesn't have termcap.h) + corrected (in main.c) some unused/orphaned variables. -------------------------------------------------------------------------------- Tekproc.c | 10 ---------- charproc.c | 9 ++------- data.h | 11 +++++++++++ input.c | 7 +++++++ main.c | 18 +---!!!!!!!!!!!!!! resize.c | 2 !! 6 files changed, 21 insertions, 20 deletions, 16 modifications -------------------------------------------------------------------------------- Index: Tekproc.c *** /build/x11r6/XFree86-3.1.2Cb-960209/xc/programs/xterm/Tekproc.c Tue Jan 30 15:59:20 1996 --- /build/x11r6/XFree86-current/xc/programs/xterm/Tekproc.c Sat Feb 10 19:02:58 1996 *************** *** 65,77 **** #include #include - #if XtSpecificationRelease >= 6 - #include - #else - #define Select(n,r,w,e,t) select(0,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval *)t) - #define XFD_COPYSET(src,dst) bcopy((src)->fds_bits, (dst)->fds_bits, sizeof(fd_set)) - #endif - #include #include #include --- 65,70 ---- *************** *** 122,130 **** extern void exit(); extern long time(); /* included in by Xos.h */ #endif - extern fd_set Select_mask; - extern fd_set X_mask; - extern fd_set pty_mask; #include "xterm.h" --- 115,120 ---- Index: charproc.c *** /build/x11r6/XFree86-3.1.2Cb-960209/xc/programs/xterm/charproc.c Fri Feb 9 21:29:53 1996 --- /build/x11r6/XFree86-current/xc/programs/xterm/charproc.c Sat Feb 10 19:02:58 1996 *************** *** 66,75 **** #if XtSpecificationRelease >= 6 #include - #include - #else - #define Select(n,r,w,e,t) select(0,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval *)t) - #define XFD_COPYSET(src,dst) bcopy((src)->fds_bits, (dst)->fds_bits, sizeof(fd_set)) #endif #include --- 66,71 ---- *************** *** 120,128 **** extern XtAppContext app_con; extern Widget toplevel; extern char *ProgramName; - extern fd_set Select_mask; - extern fd_set X_mask; - extern fd_set pty_mask; static int LoadNewFont PROTO((TScreen *screen, char *nfontname, char *bfontname, Bool doresize, int fontnum)); static int finput PROTO((void)); --- 116,121 ---- *************** *** 2851,2856 **** --- 2844,2851 ---- #if XtSpecificationRelease >= 6 VTInitI18N(); + #else + term->screen.xic = NULL; #endif set_cursor_gcs (screen); Index: data.h *** /build/x11r6/XFree86-3.1.2Cb-960209/xc/programs/xterm/data.h Tue Jan 16 15:43:01 1996 --- /build/x11r6/XFree86-current/xc/programs/xterm/data.h Sat Feb 10 19:02:58 1996 *************** *** 24,29 **** --- 24,36 ---- * SOFTWARE. */ + #if XtSpecificationRelease >= 6 + #include + #else + #define Select(n,r,w,e,t) select(n,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval *)t) + #define XFD_COPYSET(src,dst) bcopy((src)->fds_bits, (dst)->fds_bits, sizeof(fd_set)) + #endif + extern TekLink *TekRefresh; extern XPoint T_box2[]; extern XPoint T_box3[]; *************** *** 54,59 **** --- 61,70 ---- extern int errno; extern int max_plus1; extern int switchfb[]; + + extern fd_set Select_mask; + extern fd_set X_mask; + extern fd_set pty_mask; extern int waitingForTrackInfo; Index: input.c *** /build/x11r6/XFree86-3.1.2Cb-960209/xc/programs/xterm/input.c Wed Jan 17 14:16:01 1996 --- /build/x11r6/XFree86-current/xc/programs/xterm/input.c Sat Feb 10 19:02:58 1996 *************** *** 86,95 **** --- 86,102 ---- int nbytes; KeySym keysym = 0; ANSI reply; + + #if XtSpecificationRelease >= 6 Status status_return; nbytes = XmbLookupString (screen->xic, event, strbuf, STRBUFSIZE, &keysym, &status_return); + #else + static XComposeStatus compose_status = {NULL, 0}; + nbytes = XLookupString (event, strbuf, STRBUFSIZE, + &keysym, &compose_status); + #endif string = &strbuf[0]; reply.a_pintro = 0; Index: main.c *** /build/x11r6/XFree86-3.1.2Cb-960209/xc/programs/xterm/main.c Tue Jan 30 15:59:20 1996 --- /build/x11r6/XFree86-current/xc/programs/xterm/main.c Sat Feb 10 19:11:44 1996 *************** *** 1593,1604 **** #endif #ifndef AMOEBA #ifdef MINIX ! if ((mode = fcntl(pty, F_GETFD, 0)) == -1) Error(1); mode |= FD_ASYNCHIO; ! if (fcntl(pty, F_SETFD, mode) == -1) Error(1); ! nbio_register(pty); #else /* !MINIX */ #ifdef USE_SYSV_TERMIO if (0 > (mode = fcntl(screen->respond, F_GETFL, 0))) --- 1593,1604 ---- #endif #ifndef AMOEBA #ifdef MINIX ! if ((mode = fcntl(screen->respond, F_GETFD, 0)) == -1) Error(1); mode |= FD_ASYNCHIO; ! if (fcntl(screen->respond, F_SETFD, mode) == -1) Error(1); ! nbio_register(screen->respond); #else /* !MINIX */ #ifdef USE_SYSV_TERMIO if (0 > (mode = fcntl(screen->respond, F_GETFL, 0))) *************** *** 3655,3662 **** Exit(n) int n; { - register TScreen *screen = &term->screen; - int pty = term->screen.respond; /* file descriptor of pty */ #ifdef UTMP #ifdef USE_SYSV_UTMP #ifdef SVR4 --- 3655,3660 ---- *************** *** 3698,3704 **** (void) setutent(); utptr = getutid(&utmp); /* write it out only if it exists, and the pid's match */ ! if (utptr && (utptr->ut_pid == screen->pid)) { utptr->ut_type = DEAD_PROCESS; #ifdef SVR4 utmp.ut_session = getsid(0); --- 3696,3702 ---- (void) setutent(); utptr = getutid(&utmp); /* write it out only if it exists, and the pid's match */ ! if (utptr && (utptr->ut_pid == term->screen.pid)) { utptr->ut_type = DEAD_PROCESS; #ifdef SVR4 utmp.ut_session = getsid(0); *************** *** 3727,3733 **** } #else /* not USE_SYSV_UTMP */ register int wfd; - register int i; struct utmp utmp; if (!resource.utmpInhibit && added_utmp_entry && --- 3725,3730 ---- *************** *** 3739,3744 **** --- 3736,3742 ---- #ifdef WTMP if (term->misc.login_shell && (wfd = open(etc_wtmp, O_WRONLY | O_APPEND)) >= 0) { + register int i; (void) strncpy(utmp.ut_line, ttydev + sizeof("/dev"), sizeof (utmp.ut_line)); time(&utmp.ut_time); *************** *** 3750,3760 **** #endif /* USE_SYSV_UTMP */ #endif /* UTMP */ #ifndef AMOEBA ! close(pty); /* close explicitly to avoid race with slave side */ #endif #ifdef ALLOWLOGGING ! if(screen->logging) ! CloseLog(screen); #endif #ifndef AMOEBA --- 3748,3758 ---- #endif /* USE_SYSV_UTMP */ #endif /* UTMP */ #ifndef AMOEBA ! close(term->screen.respond); /* close explicitly to avoid race with slave side */ #endif #ifdef ALLOWLOGGING ! if(term->screen.logging) ! CloseLog(&term->screen); #endif #ifndef AMOEBA Index: resize.c *** /build/x11r6/XFree86-3.1.2Cb-960209/xc/programs/xterm/resize.c Sun Jan 14 14:18:01 1996 --- /build/x11r6/XFree86-current/xc/programs/xterm/resize.c Sat Feb 10 19:02:58 1996 *************** *** 220,226 **** #ifdef USE_TERMCAP static char *strindex PROTO((char *s1, char *s2)); ! #ifndef __NetBSD__ #include #else #include --- 220,226 ---- #ifdef USE_TERMCAP static char *strindex PROTO((char *s1, char *s2)); ! #if !defined(__NetBSD__) && !(defined(sun) && !defined(SVR4)) #include #else #include