home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume9 / siotools / patch02 < prev    next >
Encoding:
Text File  |  1989-12-07  |  12.9 KB  |  508 lines

  1. Newsgroups: comp.sources.misc
  2. subject: v09i058: siotools patch 2
  3. from: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  4. Reply-To: wht%n4hgf@gatech.edu (Warren Tucker)
  5.  
  6. Posting-number: Volume 9, Issue 58
  7. Submitted-by: wht%n4hgf@gatech.edu (Warren Tucker)
  8. Archive-name: siotools/patch02
  9.  
  10. I appreciate the mail I've recceived on uusnap and siomon...  and the
  11. bug report and suggestions.  I've gotten 1 clue about hacking this to
  12. work with ISC i386: The "standard" async port tty structure array is
  13. named 'asy_tty' and the count of items in the array is in 'num_asy'.
  14. Whereas SCO maintains one array of tty structures for all tty devices,
  15. whether single 0x3f8/0x2f8 standard ports or multi-port expansion
  16. boards, this seems not to be the case with ISC.  More than one kmem
  17. read will be necessary to read asy_tty and ???_tty [ ...  and ??2_tty
  18. ...  ] into an aggregate array.  Another mechanism will be needed to
  19. map array indices to /dev/ttynames.  I would appreciate hearing of any
  20. work you might do.
  21. -----------------------------------------------------------------------
  22. Warren Tucker,  Mountain Park, Georgia       ...!gatech!kd4nc!n4hgf!wht 
  23.  
  24. --------------- cut here --------------
  25. :
  26. # This is a shell archive (shar 3.04)
  27. # made 12/07/1989 08:32 UTC by gatech!kd4nc!n4hgf!wht
  28. # Source directory /u4/src/uusnap/x
  29. #
  30. # siotools v09i044/v09i45 Patch 2
  31. # uusnap bug fix and changes described in the enclosed file
  32. # Just unshar in the siotools source directory and type 'sh PATCH.2'
  33. #
  34. echo "x - extracting PATCH.2 (Text)"
  35. sed 's/^X//' << 'SHAR_EOF' > PATCH.2 &&
  36. X:
  37. X#----------------------------------------------------------------------
  38. X# siotools v09i044/v09i45 Patch 2    -- affects uusnap only
  39. X# 1. Fix race condition with status update vs. tty->no-tty transition
  40. X# 2. Increase number of displayable connections
  41. X# 3. document ESC as quit key
  42. X#----------------------------------------------------------------------
  43. X#+:EDITS:
  44. X#:12-07-1989-03:26-wht-creation
  45. X
  46. Xsed -e 's/^P//' << DIFF_EOF | patch
  47. XP*** uusnap161.c
  48. XP--- uusnap.c
  49. XP**************
  50. XP*** 1,5
  51. XP! /* CHK=0x5B7C */
  52. XP! char *revision = "1.61";
  53. XP  /*+-------------------------------------------------------------------------
  54. XP      uusnap.c - display UUCP communications status for HDB systems
  55. XP      ...gatech!kd4nc!n4hgf!wht
  56. XP--- 1,5 -----
  57. XP! /* CHK=0xD9CC */
  58. XP! char *revision = "1.62";
  59. XP  /*+-------------------------------------------------------------------------
  60. XP      uusnap.c - display UUCP communications status for HDB systems
  61. XP      ...gatech!kd4nc!n4hgf!wht
  62. XP**************
  63. XP*** 32,37
  64. XP  
  65. XP  --------------------------------------------------------------------------*/
  66. XP  /*+:EDITS:*/
  67. XP  /*:12-04-1989-16:45-wht-add detail in full */
  68. XP  /*:12-01-1989-16:53-wht-XENIX 286 work: no beep()! */
  69. XP  /*:11-30-1989-17:48-wht-complete rewrite to add detail status */
  70. XP--- 32,38 -----
  71. XP  
  72. XP  --------------------------------------------------------------------------*/
  73. XP  /*+:EDITS:*/
  74. XP+ /*:12-07-1989-03:10-wht-make changes per email suggestions */
  75. XP  /*:12-04-1989-16:45-wht-add detail in full */
  76. XP  /*:12-01-1989-16:53-wht-XENIX 286 work: no beep()! */
  77. XP  /*:11-30-1989-17:48-wht-complete rewrite to add detail status */
  78. XP**************
  79. XP*** 92,98
  80. XP  char *LOCKDIR = "/usr/spool/uucp/LCK..";
  81. XP  char *WORKDIR = "/usr/spool/uucp/";
  82. XP  char *SPOOLDIR = "/usr/spool/uucp";
  83. XP- char *LOGFILE = "/tmp/uuexp.log";
  84. XP  
  85. XP  #define MAX_SYSTEMS (LINES - FIRSTSYS_Y - 6)
  86. XP  #define WAITSECS_ACTIVE 1 /* sleep secs between samples when talking */
  87. XP--- 93,98 -----
  88. XP  char *LOCKDIR = "/usr/spool/uucp/LCK..";
  89. XP  char *WORKDIR = "/usr/spool/uucp/";
  90. XP  char *SPOOLDIR = "/usr/spool/uucp";
  91. XP  
  92. XP  #define MAX_SYSTEMS (LINES - FIRSTSYS_Y - 4)
  93. XP  #define WAITSECS_ACTIVE 1 /* sleep secs between samples when talking */
  94. XP**************
  95. XP*** 94,100
  96. XP  char *SPOOLDIR = "/usr/spool/uucp";
  97. XP  char *LOGFILE = "/tmp/uuexp.log";
  98. XP  
  99. XP! #define MAX_SYSTEMS (LINES - FIRSTSYS_Y - 6)
  100. XP  #define WAITSECS_ACTIVE 1 /* sleep secs between samples when talking */
  101. XP  #define WAITSECS_IDLE   7 /* sleep secs between samples when not talking */
  102. XP  
  103. XP--- 94,100 -----
  104. XP  char *WORKDIR = "/usr/spool/uucp/";
  105. XP  char *SPOOLDIR = "/usr/spool/uucp";
  106. XP  
  107. XP! #define MAX_SYSTEMS (LINES - FIRSTSYS_Y - 4)
  108. XP  #define WAITSECS_ACTIVE 1 /* sleep secs between samples when talking */
  109. XP  #define WAITSECS_IDLE   7 /* sleep secs between samples when not talking */
  110. XP  
  111. XP**************
  112. XP*** 354,360
  113. XP      if(stdscr)
  114. XP      {
  115. XP          standend();
  116. XP!         move(LINES - 4,0);
  117. XP          clrtobot();
  118. XP          refresh();
  119. XP          echo();
  120. XP--- 354,360 -----
  121. XP      if(stdscr)
  122. XP      {
  123. XP          standend();
  124. XP!         move(LINES - 2,0);
  125. XP          clrtobot();
  126. XP          refresh();
  127. XP          echo();
  128. XP**************
  129. XP*** 408,414
  130. XP  cmd_line(text)
  131. XP  char *text;
  132. XP  {
  133. XP!     move(LINES - 4,0);
  134. XP      clrtoeol();
  135. XP  
  136. XP      if(!text)
  137. XP--- 408,414 -----
  138. XP  cmd_line(text)
  139. XP  char *text;
  140. XP  {
  141. XP!     move(LINES - 2,0);
  142. XP      clrtoeol();
  143. XP  
  144. XP      if(!text)
  145. XP**************
  146. XP*** 413,419
  147. XP  
  148. XP      if(!text)
  149. XP          addstr(
  150. XP!         "type 'q' to quit, 'd' for detail, SPACE to update immediately");
  151. XP      else
  152. XP          addstr(text);
  153. XP  
  154. XP--- 413,419 -----
  155. XP  
  156. XP      if(!text)
  157. XP          addstr(
  158. XP!         "type ESC/'q' to quit, 'd' for detail, SPACE to update immediately");
  159. XP      else
  160. XP          addstr(text);
  161. XP  
  162. XP**************
  163. XP*** 607,613
  164. XP  {
  165. XP  register int x;
  166. XP  register int y;
  167. XP! register unsigned int itmp;
  168. XP  char s8[8];
  169. XP  
  170. XP      getyx(stdscr,y,x);
  171. XP--- 607,613 -----
  172. XP  {
  173. XP  register int x;
  174. XP  register int y;
  175. XP! register unsigned itmp;
  176. XP  char s8[8];
  177. XP  
  178. XP      clrtoeol();
  179. XP**************
  180. XP*** 610,615
  181. XP  register unsigned int itmp;
  182. XP  char s8[8];
  183. XP  
  184. XP      getyx(stdscr,y,x);
  185. XP      move(y,TX + x);
  186. XP      addch((sionum < 8) ? '1' : '2');
  187. XP--- 610,616 -----
  188. XP  register unsigned itmp;
  189. XP  char s8[8];
  190. XP  
  191. XP+     clrtoeol();
  192. XP      getyx(stdscr,y,x);
  193. XP      move(y,TX + x);
  194. XP      addch((sionum < 8) ? '1' : '2');
  195. XP**************
  196. XP*** 682,687
  197. XP  int y,x;
  198. XP  int sysdetail;
  199. XP  int ttnum;
  200. XP  char *sysname;
  201. XP  char *cptr;
  202. XP  
  203. XP--- 683,689 -----
  204. XP  int y,x;
  205. XP  int sysdetail;
  206. XP  int ttnum;
  207. XP+ int have_tty = 0;
  208. XP  char *sysname;
  209. XP  char *cptr;
  210. XP  
  211. XP**************
  212. XP*** 689,694
  213. XP      "tty  raw  can   out   speed  state iflag  oflag  cflag  lflag  pgrp";
  214. XP  static char *hyphens =
  215. XP      "---  ---  ---  -----  -----  ----- ------ ------ ------ ------ -----";
  216. XP  
  217. XP  
  218. XP      cmd_line("display detail on system #: __");
  219. XP--- 691,702 -----
  220. XP      "tty  raw  can   out   speed  state iflag  oflag  cflag  lflag  pgrp";
  221. XP  static char *hyphens =
  222. XP      "---  ---  ---  -----  -----  ----- ------ ------ ------ ------ -----";
  223. XP+ static char *press_any_key =
  224. XP+     "press any key to return to main display  ";
  225. XP+ static char *state1 =
  226. XP+     "State: W waiting for open to complete  O open  C carrier on";
  227. XP+ static char *state2 =
  228. XP+     "       S stopped by XOFF  D delay timeout in progress ";
  229. XP  
  230. XP      cmd_line("display detail on system #: __");
  231. XP      getyx(stdscr,y,x);
  232. XP**************
  233. XP*** 690,696
  234. XP  static char *hyphens =
  235. XP      "---  ---  ---  -----  -----  ----- ------ ------ ------ ------ -----";
  236. XP  
  237. XP- 
  238. XP      cmd_line("display detail on system #: __");
  239. XP      getyx(stdscr,y,x);
  240. XP      move(y,x - 2);
  241. XP--- 698,703 -----
  242. XP  static char *state2 =
  243. XP      "       S stopped by XOFF  D delay timeout in progress ";
  244. XP  
  245. XP      cmd_line("display detail on system #: __");
  246. XP      getyx(stdscr,y,x);
  247. XP      move(y,x - 2);
  248. XP**************
  249. XP*** 708,714
  250. XP          return;
  251. XP      }
  252. XP  
  253. XP-     cmd_line("press any key to return to main display  ");
  254. XP      sysname = sysnames + (sysdetail << 4);
  255. XP      y = FIRSTSYS_Y;
  256. XP      move(y,0);
  257. XP--- 715,720 -----
  258. XP          return;
  259. XP      }
  260. XP  
  261. XP      sysname = sysnames + (sysdetail << 4);
  262. XP      y = FIRSTSYS_Y;
  263. XP      move(y,0);
  264. XP**************
  265. XP*** 713,718
  266. XP      y = FIRSTSYS_Y;
  267. XP      move(y,0);
  268. XP      clrtobot();
  269. XP  
  270. XP      move(y+4,0);
  271. XP      addstr(header);
  272. XP--- 719,725 -----
  273. XP      y = FIRSTSYS_Y;
  274. XP      move(y,0);
  275. XP      clrtobot();
  276. XP+     cmd_line(press_any_key);
  277. XP  
  278. XP      while(1)
  279. XP      {
  280. XP**************
  281. XP*** 714,731
  282. XP      move(y,0);
  283. XP      clrtobot();
  284. XP  
  285. XP-     move(y+4,0);
  286. XP-     addstr(header);
  287. XP-     move(y+5,0);
  288. XP-     addstr(hyphens);
  289. XP-     move(y+8,0);
  290. XP-     addstr(
  291. XP- "State: W waiting for open to complete  O open  C carrier on");
  292. XP-     move(y+9,0);
  293. XP-     addstr(
  294. XP- "       S stopped by XOFF  D delay timeout in progress ");
  295. XP- 
  296. XP- 
  297. XP      while(1)
  298. XP      {
  299. XP          display_tod();    /* display time and get 'secs_now' */
  300. XP--- 721,726 -----
  301. XP      clrtobot();
  302. XP      cmd_line(press_any_key);
  303. XP  
  304. XP      while(1)
  305. XP      {
  306. XP          display_tod();    /* display time and get 'secs_now' */
  307. XP**************
  308. XP*** 736,741
  309. XP              printw("cannot get status for %s",sysname);
  310. XP              standend();
  311. XP              clrtobot();
  312. XP              goto DETAIL_SLEEP;
  313. XP          }
  314. XP  
  315. XP--- 731,737 -----
  316. XP              printw("cannot get status for %s",sysname);
  317. XP              standend();
  318. XP              clrtobot();
  319. XP+             cmd_line(press_any_key);
  320. XP              goto DETAIL_SLEEP;
  321. XP          }
  322. XP  
  323. XP**************
  324. XP*** 742,748
  325. XP                              /* 00000 */
  326. XP                              /* 01234 */
  327. XP                              /* ttyxx */
  328. XP!         move(y+6,0);
  329. XP          if(locked_tty[0] && ((locked_tty[3] == '1') || (locked_tty[3] == '2')))
  330. XP          {
  331. XP              ttnum = ((locked_tty[3] - '1') * 8) + ((locked_tty[4] & 7) - 1);
  332. XP--- 738,744 -----
  333. XP                              /* 00000 */
  334. XP                              /* 01234 */
  335. XP                              /* ttyxx */
  336. XP!         move(y+5,0);
  337. XP          if(locked_tty[0] && ((locked_tty[3] == '1') || (locked_tty[3] == '2')))
  338. XP          {
  339. XP              ttnum = ((locked_tty[3] - '1') * 8) + ((locked_tty[4] & 7) - 1);
  340. XP**************
  341. XP*** 752,758
  342. XP                  addstr(cptr);
  343. XP                  addstr(": ");
  344. XP                  addstr(locked_tty);
  345. XP-                 cmd_line("press any key to return to main display  ");
  346. XP                  standend();
  347. XP                  refresh();
  348. XP                  getch();
  349. XP--- 748,753 -----
  350. XP                  addstr(cptr);
  351. XP                  addstr(": ");
  352. XP                  addstr(locked_tty);
  353. XP                  standend();
  354. XP                  refresh();
  355. XP                  getch();
  356. XP**************
  357. XP*** 758,764
  358. XP                  getch();
  359. XP                  goto DETAIL_EXIT;
  360. XP              }
  361. XP!             clrtoeol();
  362. XP              display_tty(ttnum,&sio[0]);
  363. XP              wintty_template(stdscr,y+11,0,1);
  364. XP              wintty(stdscr,y+11,0,&sio[0]);
  365. XP--- 753,771 -----
  366. XP                  getch();
  367. XP                  goto DETAIL_EXIT;
  368. XP              }
  369. XP!             if(!have_tty)
  370. XP!             {
  371. XP!                 move(y+3,0);
  372. XP!                 addstr(header);
  373. XP!                 move(y+4,0);
  374. XP!                 addstr(hyphens);
  375. XP!                 move(y+7,0);
  376. XP!                 addstr(state1);
  377. XP!                 move(y+8,0);
  378. XP!                 addstr(state2);
  379. XP!             }
  380. XP!             have_tty = 1;
  381. XP!             move(y+5,0);
  382. XP              display_tty(ttnum,&sio[0]);
  383. XP              wintty_template(stdscr,y+10,0,1);
  384. XP              wintty(stdscr,y+10,0,&sio[0]);
  385. XP**************
  386. XP*** 760,768
  387. XP              }
  388. XP              clrtoeol();
  389. XP              display_tty(ttnum,&sio[0]);
  390. XP!             wintty_template(stdscr,y+11,0,1);
  391. XP!             wintty(stdscr,y+11,0,&sio[0]);
  392. XP!             move(y+11,0);
  393. XP          }
  394. XP          else
  395. XP          {
  396. XP--- 767,775 -----
  397. XP              have_tty = 1;
  398. XP              move(y+5,0);
  399. XP              display_tty(ttnum,&sio[0]);
  400. XP!             wintty_template(stdscr,y+10,0,1);
  401. XP!             wintty(stdscr,y+10,0,&sio[0]);
  402. XP!             move(y+10,0);
  403. XP          }
  404. XP          else
  405. XP          {
  406. XP**************
  407. XP*** 766,771
  408. XP          }
  409. XP          else
  410. XP          {
  411. XP              printw(" no tty or non-async connection");
  412. XP              clrtoeol();
  413. XP              wintty_template(stdscr,y+11,0,0);
  414. XP--- 773,781 -----
  415. XP          }
  416. XP          else
  417. XP          {
  418. XP+             move(y+3,0);
  419. XP+             clrtobot();
  420. XP+             move(y+5,0);
  421. XP              printw(" no tty or non-async connection");
  422. XP              cmd_line(press_any_key);
  423. XP              have_tty = 0;
  424. XP**************
  425. XP*** 767,774
  426. XP          else
  427. XP          {
  428. XP              printw(" no tty or non-async connection");
  429. XP!             clrtoeol();
  430. XP!             wintty_template(stdscr,y+11,0,0);
  431. XP          }
  432. XP  
  433. XP  DETAIL_SLEEP:
  434. XP--- 777,786 -----
  435. XP              clrtobot();
  436. XP              move(y+5,0);
  437. XP              printw(" no tty or non-async connection");
  438. XP!             cmd_line(press_any_key);
  439. XP!             have_tty = 0;
  440. XP!             wintty_template(stdscr,y+10,0,0);
  441. XP!             move(LINES - 2,0);
  442. XP          }
  443. XP  
  444. XP  DETAIL_SLEEP:
  445. XP**************
  446. XP*** 886,892
  447. XP              bye(255);
  448. XP          }
  449. XP          display_delta_y = systems = 0;
  450. XP-         move(LINES - 4,0);
  451. XP          move(FIRSTSYS_Y,0);
  452. XP          while(dp = dir_read(stat_dp))
  453. XP          {
  454. XP--- 898,903 -----
  455. XP              bye(255);
  456. XP          }
  457. XP          display_delta_y = systems = 0;
  458. XP          move(FIRSTSYS_Y,0);
  459. XP          while(dp = dir_read(stat_dp))
  460. XP          {
  461. XP**************
  462. XP*** 903,916
  463. XP              display_status(systems,sysname,display_delta_y + FIRSTSYS_Y,linebuf);
  464. XP              display_delta_y++;
  465. XP          }
  466. XP-         move(display_delta_y + FIRSTSYS_Y,0);
  467. XP-         clrtoeol();
  468. XP-         display_delta_y++;
  469. XP-         move(display_delta_y + FIRSTSYS_Y,0);
  470. XP-         addstr("UUCP connections active: ");
  471. XP-         utoda(s32,2,systems);
  472. XP-         addstr(s32);
  473. XP-         display_delta_y++;
  474. XP          while(display_delta_y < MAX_SYSTEMS)
  475. XP          {
  476. XP              move(display_delta_y++ + FIRSTSYS_Y,0);
  477. XP--- 914,919 -----
  478. XP              display_status(systems,sysname,display_delta_y + FIRSTSYS_Y,linebuf);
  479. XP              display_delta_y++;
  480. XP          }
  481. XP          while(display_delta_y < MAX_SYSTEMS)
  482. XP          {
  483. XP              move(display_delta_y++ + FIRSTSYS_Y,0);
  484. XP**************
  485. XP*** 918,924
  486. XP          }
  487. XP  
  488. XP          dir_close(stat_dp);
  489. XP!         move(LINES - 4,0);
  490. XP          refresh();
  491. XP  
  492. XP  #if defined(M_UNIX)
  493. XP--- 921,927 -----
  494. XP          }
  495. XP  
  496. XP          dir_close(stat_dp);
  497. XP!         move(LINES - 2,0);
  498. XP          refresh();
  499. XP  
  500. XP  #if defined(M_UNIX)
  501. XDIFF_EOF
  502. Xexit 0
  503. SHAR_EOF
  504. chmod 0755 PATCH.2 || echo "restore of PATCH.2 fails"
  505. exit 0
  506.  
  507.  
  508.