wht%n4hgf@gatech.edu (Warren Tucker) (02/14/90)
Posting-number: Volume 10, Issue 70 Submitted-by: wht%n4hgf@gatech.edu (Warren Tucker) Archive-name: siotools/patch05 Many thanks for the XENIX debugging help by Jim Stratton (stratton@hpda.da.com) #!/bin/sh # This is siotools.PATCH.5, a shell archive (shar 3.04) # made 02/13/1990 19:32 UTC by gatech!kd4nc!n4hgf!wht (wht%n4hgf@gatech.edu) # Source directory /u4/src/uusnap/rel # # siotools v09i044/v09i45 Patch 5 # This patch affects uusnap and siomon # 1. Fix XENIX compilation bugs (IS_OPEN-->ISOPEN) # 2. Fix tty not restored properly under some XENIX curses libraries # 3. Add tty->t_state descriptions # 4. Increase update speed during "detail" display # # existing files WILL be overwritten # # This shar contains: # PATCH.5 # touch 2>&1 | fgrep '[-amc]' > /tmp/s3_touch$$ if [ -s /tmp/s3_touch$$ ] then TOUCH=can else TOUCH=cannot fi rm -f /tmp/s3_touch$$ echo "x - extracting PATCH.5 (Text)" sed 's/^X//' << 'SHAR_EOF' > PATCH.5 && X: X#---------------------------------------------------------------------- X# siotools v09i044/v09i45 Patch 5 X# This patch affects uusnap and siomon X# 1. Fix XENIX compilation bugs (IS_OPEN-->ISOPEN) X# 2. Fix tty not restored properly under some XENIX curses libraries X# 3. Add tty->t_state descriptions X# 4. Increase update speed during "detail" display X#---------------------------------------------------------------------- X#+:EDITS: X#:01-27-1990-19:42-wht-creation X Xsed -e 's/^P//' << DIFF_EOF | patch XP*** rel/siomon.c Mon Feb 5 16:06:24 1990 XP--- siomon.c Tue Feb 13 14:22:17 1990 XP*************** XP*** 1,5 XP /* CHK=0x75B9 */ XP! char *revision = "1.33"; XP /*+------------------------------------------------------------------------- XP siomon.c -- watch XENIX/UNIX serial I/O XP ...!gatech!kd4nc!n4hgf!wht XP XP--- 1,5 ----- XP /* CHK=0x75B9 */ XP! char *revision = "1.35"; XP /*+------------------------------------------------------------------------- XP siomon.c -- watch XENIX/UNIX serial I/O XP ...!gatech!kd4nc!n4hgf!wht XP*************** XP*** 3,8 XP /*+------------------------------------------------------------------------- XP siomon.c -- watch XENIX/UNIX serial I/O XP ...!gatech!kd4nc!n4hgf!wht XP XP Sample output: XP 000000000011111111112222222222333333333344444444445555555555666666666677777 XP XP--- 3,9 ----- XP /*+------------------------------------------------------------------------- XP siomon.c -- watch XENIX/UNIX serial I/O XP ...!gatech!kd4nc!n4hgf!wht XP+ XENIX debugging help by Jim Stratton (stratton@hpda.da.com) XP XP Sample output: XP 000000000011111111112222222222333333333344444444445555555555666666666677777 XP*************** XP*** 5,36 XP ...!gatech!kd4nc!n4hgf!wht XP XP Sample output: XP! 000000000011111111112222222222333333333344444444445555555555666666666677777 XP! 012345678901234567890123456789012345678901234567890123456789012345678901234 XP! 00 siomon 1.2 (UNIX V.3.2/i386) n4hgf delay: 1 21:54:54 XP! 01 XP! 02 tty raw can out speed state iflag oflag cflag lflag pgrp XP! 03 --- --- --- ----- ----- ----- ------ ------ ------ ------ ----- XP! 04 1a 0 0 0 9600 OC 10045 0 6655 0 0 XP! 05 1b XP! 06 1c XP! 07 1d XP! 08 1e XP! 09 1f XP! 10 1g XP! 11 1h XP! 12 2a XP! 13 2b XP! 14 2c XP! 15 2d 0 0 0 9600 W 0 0 2275 0 0 XP! 16 2e XP! 17 2f 0 0 0 4800 OC 10040 0 2374 0 0 XP! 18 2g 0 0 0 4800 OC 10005 0 6374 0 0 XP! 19 2h XP! 20 XP! 21 State: W waiting for open to complete O open C carrier on XP! 22 S stopped by XOFF D delay timeout in progress XP! 23 Commands: + inc delay - dec delay ^L refresh q quit d detail XP XP Under XENIX, termio.h is included twice (once by curses.h/tcap.h andf XP again by sys/tty.h. You need to bracket the termio.h under XENIX with XP XP--- 6,37 ----- XP XENIX debugging help by hplabs!hpcupt1!stratton XP XP Sample output: XP! 000000000011111111112222222222333333333344444444445555555555666666666677777 XP! 012345678901234567890123456789012345678901234567890123456789012345678901234 XP! 00 siomon 1.34 (UNIX V.3.2/i386) n4hgf delay: 1 21:54:54 XP! 01 XP! 02 tty raw can out speed state iflag oflag cflag lflag pgrp XP! 03 --- --- --- ----- ----- ----- ------ ------ ------ ------ ----- XP! 04 1a 0 0 0 9600 OC 10045 0 6655 0 0 XP! 05 1b XP! 06 1c XP! 07 1d XP! 08 1e XP! 09 1f XP! 10 1g XP! 11 1h XP! 12 2a XP! 13 2b XP! 14 2c XP! 15 2d 0 0 0 9600 W 0 0 2275 0 0 XP! 16 2e XP! 17 2f 0 0 0 4800 OC 10040 0 2374 0 0 XP! 18 2g 0 0 0 4800 OC 10005 0 6374 0 0 XP! 19 2h XP! 20 XP! 21 State: W waiting for open to complete O open C carrier on XP! 22 S stopped by XOFF D delay timeout in progress XP! 23 Commands: + inc delay - dec delay ^L refresh q quit d detail XP XP Under XENIX, termio.h is included twice (once by curses.h/tcap.h andf XP again by sys/tty.h. You need to bracket the termio.h under XENIX with XP*************** XP*** 104,111 XP { XP if(!stdscr) XP { XP! nocrmode(); XP! echo(); XP exit(0); XP } XP move(LINES - 1,0); XP XP--- 105,111 ----- XP { XP if(!stdscr) XP { XP! resetty(); XP exit(0); XP } XP move(LINES - 1,0); XP*************** XP*** 175,181 XP if(tty->t_state & TTSTOP) XP s8[3] = 'S'; XP if(tty->t_state & TIMEOUT) XP! s8[3] = 'D'; XP move(y,FX + xo); XP addstr(s8); XP XP XP--- 175,181 ----- XP if(tty->t_state & TTSTOP) XP s8[3] = 'S'; XP if(tty->t_state & TIMEOUT) XP! s8[4] = 'D'; XP move(y,FX + xo); XP addstr(s8); XP XP*************** XP*** 280,286 XP "State: W waiting for open to complete O open C carrier on"); XP move(LINES - 3,0); XP addstr( XP! " S stopped by XOFF D delay timeout in progress "); XP move(LINES - 2,0); XP addstr( XP "Commands: + inc delay - dec delay ^L refresh q quit d detail"); XP XP--- 280,286 ----- XP "State: W waiting for open to complete O open C carrier on"); XP move(LINES - 3,0); XP addstr( XP! " S stopped by XOFF D delay timeout in progress B transmitter busy"); XP move(LINES - 2,0); XP addstr( XP "Commands: + inc delay - dec delay ^L refresh q quit d detail"); XP*************** XP*** 326,332 XP XP if((strlen(tty_name) == 2) && XP ((tty_name[0] == '1') || (tty_name[0] == '2'))) XP! sionum = ((tty_name[0] - '1') * 8) + ((tty_name[1] & 7) - 1); XP else XP { XP fputc(7,stderr); XP XP--- 326,332 ----- XP XP if((strlen(tty_name) == 2) && XP ((tty_name[0] == '1') || (tty_name[0] == '2'))) XP! sionum = ((tty_name[0] - '1') * 8) + ((tty_name[1] & 0xF) - 1); XP else XP { XP fputc(7,stderr); XP*************** XP*** 350,356 XP #if defined(HAVE_SELECT) XP readfds = 1; /* for standard input */ XP timeout.tv_sec = delay_secs; XP! timeout.tv_usec = (delay_secs) ? 0 : 100*1000L; XP cmd_available = (select(32,&readfds,0,0,&timeout) > 0); XP #else XP ltimeout = (delay_secs) ? (delay_secs * 1000L) : 100L; XP XP--- 350,360 ----- XP #if defined(HAVE_SELECT) XP readfds = 1; /* for standard input */ XP timeout.tv_sec = delay_secs; XP! timeout.tv_usec = (delay_secs) XP! ? 0 XP! : ((sio[0].t_state & ISOPEN) XP! ? 20*1000L XP! : 200*1000L); XP cmd_available = (select(32,&readfds,0,0,&timeout) > 0); XP #else XP ltimeout = (delay_secs) XP*************** XP*** 353,359 XP timeout.tv_usec = (delay_secs) ? 0 : 100*1000L; XP cmd_available = (select(32,&readfds,0,0,&timeout) > 0); XP #else XP! ltimeout = (delay_secs) ? (delay_secs * 1000L) : 100L; XP while(ltimeout > 0) XP { XP ltimeout -= nap(100L); XP XP--- 357,365 ----- XP : 200*1000L); XP cmd_available = (select(32,&readfds,0,0,&timeout) > 0); XP #else XP! ltimeout = (delay_secs) XP! ? (delay_secs * 1000L) XP! : ((sio[0].t_state & ISOPEN) ? 20L : 100L); XP while(ltimeout > 0) XP { XP ltimeout -= nap((delay_secs) ? 20L : 100L); XP*************** XP*** 356,362 XP ltimeout = (delay_secs) ? (delay_secs * 1000L) : 100L; XP while(ltimeout > 0) XP { XP! ltimeout -= nap(100L); XP if(cmd_available = rdchk(0)) XP break; XP } XP XP--- 362,368 ----- XP : ((sio[0].t_state & ISOPEN) ? 20L : 100L); XP while(ltimeout > 0) XP { XP! ltimeout -= nap((delay_secs) ? 20L : 100L); XP if(cmd_available = rdchk(0)) XP break; XP } XP*************** XP*** 417,422 XP XP setbuf(stdout,_sobuf); XP initscr(); XP crmode(); XP noecho(); XP if(!stdscr) XP XP--- 423,429 ----- XP XP setbuf(stdout,_sobuf); XP initscr(); XP+ savetty(); XP crmode(); XP noecho(); XP if(!stdscr) XP*************** XP*** 422,429 XP if(!stdscr) XP { XP fprintf(stderr,"curses init failed\n"); XP! nocrmode(); XP! echo(); XP exit(1); XP } XP main_template(); XP XP--- 429,435 ----- XP if(!stdscr) XP { XP fprintf(stderr,"curses init failed\n"); XP! resetty(); XP exit(1); XP } XP main_template(); XP*** rel/uusnap.c Mon Feb 5 16:06:26 1990 XP--- uusnap.c Tue Feb 13 14:10:27 1990 XP*************** XP*** 1,5 XP /* CHK=0xBF8D */ XP! char *revision = "1.70"; XP /*+------------------------------------------------------------------------- XP uusnap.c - display UUCP communications status for HDB systems XP ...gatech!kd4nc!n4hgf!wht XP XP--- 1,5 ----- XP /* CHK=0xBF8D */ XP! char *revision = "1.73"; XP /*+------------------------------------------------------------------------- XP uusnap.c - display UUCP communications status for HDB systems XP ...gatech!kd4nc!n4hgf!wht XP*************** XP*** 42,47 XP 4 ki4xo 01/25 01/25 successful XP --------------------------------------------------------------------------*/ XP /*+:EDITS:*/ XP /*:01-27-1990-19:11-wht-show input and output queues + cosmetics */ XP /*:12-28-1989-13:35-wht-change rev - B600 added to wintty */ XP /*:12-26-1989-14:53-wht-datetime5 month off by 1 */ XP XP--- 42,48 ----- XP 4 ki4xo 01/25 01/25 successful XP --------------------------------------------------------------------------*/ XP /*+:EDITS:*/ XP+ /*:02-07-1990-16:34-wht-use crmode and nocrmode rather than raw and noraw */ XP /*:01-27-1990-19:11-wht-show input and output queues + cosmetics */ XP /*:12-28-1989-13:35-wht-change rev - B600 added to wintty */ XP /*:12-26-1989-14:53-wht-datetime5 month off by 1 */ XP*************** XP*** 372,378 XP clrtobot(); XP refresh(); XP echo(); XP! noraw(); XP move(LINES - 1,0); XP refresh(); XP endwin(); XP XP--- 373,379 ----- XP clrtobot(); XP refresh(); XP echo(); XP! nocrmode(); XP move(LINES - 1,0); XP refresh(); XP endwin(); XP*************** XP*** 728,734 XP static char *state1 = XP "State: W waiting for open to complete O open C carrier on"; XP static char *state2 = XP! " S stopped by XOFF D delay timeout in progress "; XP XP cmd_line("display detail on system #: __"); XP getyx(stdscr,y,x); XP XP--- 729,735 ----- XP static char *state1 = XP "State: W waiting for open to complete O open C carrier on"; XP static char *state2 = XP! " S stopped by XOFF D delay timeout in progress B transmitter busy"; XP XP cmd_line("display detail on system #: __"); XP getyx(stdscr,y,x); XP*************** XP*** 736,742 XP refresh(); XP resetty(); XP x = scanw("%d",&sysdetail); XP! raw(); XP noecho(); XP sysdetail--; XP if(!x || (sysdetail > systems)) XP XP--- 737,743 ----- XP refresh(); XP resetty(); XP x = scanw("%d",&sysdetail); XP! crmode(); XP noecho(); XP sysdetail--; XP if(!x || (sysdetail > systems)) XP*************** XP*** 817,823 XP XP DETAIL_SLEEP: XP refresh(); XP- sleep(1); XP if(rdchk(0)) XP { XP getch(); XP XP--- 818,823 ----- XP XP DETAIL_SLEEP: XP refresh(); XP if(rdchk(0)) XP { XP getch(); XP*************** XP*** 823,828 XP getch(); XP break; XP } XP } XP XP DETAIL_EXIT: XP XP--- 823,829 ----- XP getch(); XP break; XP } XP+ nap((have_tty) ? 20L : 500L); XP } XP XP DETAIL_EXIT: XP*************** XP*** 852,858 XP struct timeval timeout; XP int fdmask; XP #else XP- long nap(); XP long timeout; XP #endif XP XP XP--- 853,858 ----- XP struct timeval timeout; XP int fdmask; XP #else XP long timeout; XP #endif XP XP*************** XP*** 868,874 XP } XP savetty(); XP noecho(); XP! raw(); XP XP signal(SIGTERM,bye); XP signal(SIGINT,bye); XP XP--- 868,874 ----- XP } XP savetty(); XP noecho(); XP! crmode(); XP XP signal(SIGTERM,bye); XP signal(SIGINT,bye); XP*** rel/wintty.c Mon Feb 5 16:06:27 1990 XP--- wintty.c Mon Jan 29 03:04:37 1990 XP*************** XP*** 17,22 XP XP --------------------------------------------------------------------------*/ XP /*+:EDITS:*/ XP /*:12-28-1989-13:35-wht-B600 added */ XP /*:12-21-1989-15:18-wht-display CTSFLOW and RTSFLOW if defined */ XP /*:12-04-1989-15:40-wht-creation */ XP XP--- 17,23 ----- XP XP --------------------------------------------------------------------------*/ XP /*+:EDITS:*/ XP+ /*:01-29-1990-02:45-wht-add t_state display */ XP /*:12-28-1989-13:35-wht-B600 added */ XP /*:12-21-1989-15:18-wht-display CTSFLOW and RTSFLOW if defined */ XP /*:12-04-1989-15:40-wht-creation */ XP*************** XP*** 41,46 XP { 4, 0, "lflag:" }, XP { 5, 7, "INTR QUIT ERASE KILL EOF/VMIN EOL/VTIME EOL2 SWTCH" }, XP { 6, 0, "cc:" }, XP { -1,-1, (char *)0} XP }; XP XP XP--- 42,48 ----- XP { 4, 0, "lflag:" }, XP { 5, 7, "INTR QUIT ERASE KILL EOF/VMIN EOL/VTIME EOL2 SWTCH" }, XP { 6, 0, "cc:" }, XP+ { 7, 0, "state:" }, XP { -1,-1, (char *)0} XP }; XP XP*************** XP*** 56,61 XP #define OFLAG 2 XP #define LFLAG 3 XP #define CFLAG 4 XP XP TFIELD tty_tfields[] = XP { XP XP--- 58,64 ----- XP #define OFLAG 2 XP #define LFLAG 3 XP #define CFLAG 4 XP+ #define STATE 5 XP XP TFIELD tty_tfields[] = XP { XP*************** XP*** 97,102 XP { 4, 53, "ECHONL", LFLAG, ECHONL }, XP { 4, 60, "NOFLSH", LFLAG, NOFLSH }, XP { 4, 68, "XCLUDE", LFLAG, XCLUDE }, XP { -1,-1, (char *)0, -1, -1 } XP }; XP XP XP--- 100,121 ----- XP { 4, 53, "ECHONL", LFLAG, ECHONL }, XP { 4, 60, "NOFLSH", LFLAG, NOFLSH }, XP { 4, 68, "XCLUDE", LFLAG, XCLUDE }, XP+ { 7, 7, "TO", STATE, TIMEOUT }, XP+ { 7, 10, "WO", STATE, WOPEN }, XP+ { 7, 13, "O", STATE, ISOPEN }, XP+ { 7, 15, "TB", STATE, TBLOCK }, XP+ { 7, 18, "CD", STATE, CARR_ON }, XP+ { 7, 21, "BY", STATE, BUSY }, XP+ { 7, 24, "OSLP", STATE, OASLP }, XP+ { 7, 29, "ISLP", STATE, IASLP }, XP+ { 7, 34, "STOP", STATE, TTSTOP }, XP+ { 7, 39, "EXT", STATE, EXTPROC }, XP+ { 7, 43, "TACT", STATE, TACT }, XP+ { 7, 48, "ESC", STATE, CLESC }, XP+ { 7, 52, "RTO", STATE, RTO }, XP+ { 7, 56, "IOW", STATE, TTIOW }, XP+ { 7, 60, "XON", STATE, TTXON }, XP+ { 7, 64, "XOFF", STATE, TTXOFF }, XP { -1,-1, (char *)0, -1, -1 } XP }; XP XP*************** XP*** 235,240 XP case OFLAG: flag = tty->t_oflag; break; XP case LFLAG: flag = tty->t_lflag; break; XP case CFLAG: flag = tty->t_cflag; break; XP } XP flag &= tptr->mask; XP wmove(win,tptr->y + tly,tptr->x + tlx); XP XP--- 254,260 ----- XP case OFLAG: flag = tty->t_oflag; break; XP case LFLAG: flag = tty->t_lflag; break; XP case CFLAG: flag = tty->t_cflag; break; XP+ case STATE: flag = tty->t_state; break; XP } XP flag &= tptr->mask; XP wmove(win,tptr->y + tly,tptr->x + tlx); XDIFF_EOF Xecho 'Patch 5 applied. Please type make. Then su and make install.' Xexit 0 X SHAR_EOF chmod 0755 PATCH.5 || echo "restore of PATCH.5 fails" if [ $TOUCH = can ] then touch -m 0213142990 PATCH.5 fi exit 0