home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume10 / siotools / patch04 next >
Encoding:
Text File  |  1990-01-28  |  14.3 KB  |  563 lines

  1. Newsgroups: comp.sources.misc
  2. subject: v10i049: siotools v09i044,045 patch 4
  3. from: wht%n4hgf@gatech.edu (Warren Tucker)
  4. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5.  
  6. Posting-number: Volume 10, Issue 49
  7. Submitted-by: wht%n4hgf@gatech.edu (Warren Tucker)
  8. Archive-name: siotools/patch04
  9.  
  10. #!/bin/sh
  11. # This is siotools.PATCH.4, a shell archive (shar 3.04)
  12. # made 01/28/1990 00:49 UTC by gatech!kd4nc!n4hgf!wht (wht%n4hgf@gatech.edu)
  13. # Source directory /u4/src/uusnap/release
  14. #
  15. # siotools v09i044/v09i45 Patch 4
  16. # This patch corrects two bugs and adds a feature:
  17. # 1. siomon & uusnap - 600 baud previously would not be displayed
  18. # 2. uusnap - LAST and NEXT month were off by one
  19. # 3. uusnap - both input and output work queues now displayed
  20. #
  21. # Just unshar in the siotools source directory and type 'sh PATCH.4'
  22. #
  23. # existing files WILL be overwritten
  24. #
  25. # This shar contains:
  26. #    PATCH.4
  27. #
  28. touch 2>&1 | fgrep '[-amc]' > /tmp/s3_touch$$
  29. if [ -s /tmp/s3_touch$$ ]
  30. then
  31.     TOUCH=can
  32. else
  33.     TOUCH=cannot
  34. fi
  35. rm -f /tmp/s3_touch$$
  36. echo "x - extracting PATCH.4 (Text)"
  37. sed 's/^X//' << 'SHAR_EOF' > PATCH.4 &&
  38. X:
  39. X#----------------------------------------------------------------------
  40. X# siotools v09i044/v09i45 Patch 4
  41. X# 1. siomon & uusnap - 600 baud previously would not be displayed
  42. X# 2. uusnap - LAST and NEXT month were off by one
  43. X# 3. uusnap - both input and output work queues now displayed
  44. X#----------------------------------------------------------------------
  45. X#+:EDITS:
  46. X#:01-27-1990-19:42-wht-creation
  47. X
  48. Xsed -e 's/^P//' << DIFF_EOF | patch
  49. XP*** patched_to_3/siomon.c    Sat Jan 27 19:33:18 1990
  50. XP--- siomon.c    Thu Dec 28 13:37:55 1989
  51. XP***************
  52. XP*** 1,5
  53. XP! /* CHK=0x4E4E */
  54. XP! char *revision = "1.32";
  55. XP  /*+-------------------------------------------------------------------------
  56. XP      siomon.c -- watch XENIX/UNIX serial I/O
  57. XP      ...!gatech!kd4nc!n4hgf!wht
  58. XP
  59. XP--- 1,5 -----
  60. XP! /* CHK=0x75B9 */
  61. XP! char *revision = "1.33";
  62. XP  /*+-------------------------------------------------------------------------
  63. XP      siomon.c -- watch XENIX/UNIX serial I/O
  64. XP      ...!gatech!kd4nc!n4hgf!wht
  65. XP***************
  66. XP*** 51,56
  67. XP    regarding screen and CPU efficiency in the original itpmon.c for Pyramid
  68. XP  --------------------------------------------------------------------------*/
  69. XP  /*+:EDITS:*/
  70. XP  /*:12-21-1989-15:20-wht-version number chg - CTSFLOW/RTSFLOW */
  71. XP  /*:12-04-1989-16:45-wht-add more to detail */
  72. XP  /*:11-28-1989-19:49-wht-no more sprintf and allow nap/rdchk in lieu of select */
  73. XP
  74. XP--- 51,57 -----
  75. XP    regarding screen and CPU efficiency in the original itpmon.c for Pyramid
  76. XP  --------------------------------------------------------------------------*/
  77. XP  /*+:EDITS:*/
  78. XP+ /*:12-28-1989-13:35-wht-change rev - B600 added to wintty */
  79. XP  /*:12-21-1989-15:20-wht-version number chg - CTSFLOW/RTSFLOW */
  80. XP  /*:12-04-1989-16:45-wht-add more to detail */
  81. XP  /*:11-28-1989-19:49-wht-no more sprintf and allow nap/rdchk in lieu of select */
  82. XP*** patched_to_3/uusnap.c    Sat Jan 27 19:33:12 1990
  83. XP--- uusnap.c    Sat Jan 27 19:31:54 1990
  84. XP***************
  85. XP*** 1,5
  86. XP! /* CHK=0xD9CC */
  87. XP! char *revision = "1.62";
  88. XP  /*+-------------------------------------------------------------------------
  89. XP      uusnap.c - display UUCP communications status for HDB systems
  90. XP      ...gatech!kd4nc!n4hgf!wht
  91. XP
  92. XP--- 1,5 -----
  93. XP! /* CHK=0xBF8D */
  94. XP! char *revision = "1.70";
  95. XP  /*+-------------------------------------------------------------------------
  96. XP      uusnap.c - display UUCP communications status for HDB systems
  97. XP      ...gatech!kd4nc!n4hgf!wht
  98. XP***************
  99. XP*** 4,10
  100. XP      uusnap.c - display UUCP communications status for HDB systems
  101. XP      ...gatech!kd4nc!n4hgf!wht
  102. XP  
  103. XP!   Many ideas in this program came from uustatus.c by Ed Carp 
  104. XP  
  105. XP    Defined functions:
  106. XP      basename(fullname)
  107. XP
  108. XP--- 4,10 -----
  109. XP      uusnap.c - display UUCP communications status for HDB systems
  110. XP      ...gatech!kd4nc!n4hgf!wht
  111. XP  
  112. XP!   Many ideas in this program came from uustatus.c by Ed Carp
  113. XP  
  114. XP    Defined functions:
  115. XP      basename(fullname)
  116. XP***************
  117. XP*** 30,35
  118. XP    ...
  119. XP    #endif
  120. XP  
  121. XP  --------------------------------------------------------------------------*/
  122. XP  /*+:EDITS:*/
  123. XP  /*:12-07-1989-03:10-wht-make changes per email suggestions */
  124. XP
  125. XP--- 30,45 -----
  126. XP    ...
  127. XP    #endif
  128. XP  
  129. XP+ Sample output:
  130. XP+ 
  131. XP+ uusnap 1.70 (UNIX V.3.2/i386) n4hgf                          19:28:26
  132. XP+ 
  133. XP+  # SYSTEM    CALLS OUTQ INPQ LAST  NEXT  PID   STATUS
  134. XP+ -- ------    ----- ---- ---- ----- ----- ----- ------------------------
  135. XP+  1 kd4nc        2    3       15:22 15:22       successful
  136. XP+  2 n4vu                      19:07 19:07       successful
  137. XP+  3 tridom                 1  19:17 19:17       TALKING (tty2e)
  138. XP+  4 ki4xo                     01/25 01/25       successful
  139. XP  --------------------------------------------------------------------------*/
  140. XP  /*+:EDITS:*/
  141. XP  /*:01-27-1990-19:11-wht-show input and output queues + cosmetics */
  142. XP***************
  143. XP*** 32,37
  144. XP  
  145. XP  --------------------------------------------------------------------------*/
  146. XP  /*+:EDITS:*/
  147. XP  /*:12-07-1989-03:10-wht-make changes per email suggestions */
  148. XP  /*:12-04-1989-16:45-wht-add detail in full */
  149. XP  /*:12-01-1989-16:53-wht-XENIX 286 work: no beep()! */
  150. XP
  151. XP--- 42,50 -----
  152. XP   4 ki4xo                     01/25 01/25       successful
  153. XP  --------------------------------------------------------------------------*/
  154. XP  /*+:EDITS:*/
  155. XP+ /*:01-27-1990-19:11-wht-show input and output queues + cosmetics */
  156. XP+ /*:12-28-1989-13:35-wht-change rev - B600 added to wintty */
  157. XP+ /*:12-26-1989-14:53-wht-datetime5 month off by 1 */
  158. XP  /*:12-07-1989-03:10-wht-make changes per email suggestions */
  159. XP  /*:12-04-1989-16:45-wht-add detail in full */
  160. XP  /*:12-01-1989-16:53-wht-XENIX 286 work: no beep()! */
  161. XP***************
  162. XP*** 55,66
  163. XP  
  164. XP  #define FIRSTSYS_Y    4
  165. XP  #define NAME_X        4
  166. XP! #define RCNT_X        14
  167. XP! #define QCNT_X        19
  168. XP! #define LAST_X        24
  169. XP! #define NEXT_X        30
  170. XP! #define PID_X        36
  171. XP! #define STATUS_X    42
  172. XP  
  173. XP  /* display_tty x offsets */
  174. XP  #define TX 0
  175. XP
  176. XP--- 68,80 -----
  177. XP  
  178. XP  #define FIRSTSYS_Y    4
  179. XP  #define NAME_X        4
  180. XP! #define CALLS_X        14
  181. XP! #define OUTQ_X        19
  182. XP! #define INPQ_X        24
  183. XP! #define LAST_X        29
  184. XP! #define NEXT_X        35
  185. XP! #define PID_X        41
  186. XP! #define STATUS_X    47
  187. XP  
  188. XP  /* display_tty x offsets */
  189. XP  #define TX 0
  190. XP***************
  191. XP*** 77,83
  192. XP  #define DDIR FILE
  193. XP  DDIR *stat_dp;
  194. XP  DDIR *work_dp;
  195. XP! struct dent 
  196. XP  {
  197. XP      unsigned short d_inode;
  198. XP      char d_name[14];
  199. XP
  200. XP--- 91,97 -----
  201. XP  #define DDIR FILE
  202. XP  DDIR *stat_dp;
  203. XP  DDIR *work_dp;
  204. XP! struct dent
  205. XP  {
  206. XP      unsigned short d_inode;
  207. XP      char d_name[14];
  208. XP***************
  209. XP*** 188,195
  210. XP  dir_read(dirp)
  211. XP  DDIR *dirp;
  212. XP  {
  213. XP! static struct dent_w_null { 
  214. XP!     struct dent dent; 
  215. XP      int null;
  216. XP  } static_dent;
  217. XP  
  218. XP
  219. XP--- 202,209 -----
  220. XP  dir_read(dirp)
  221. XP  DDIR *dirp;
  222. XP  {
  223. XP! static struct dent_w_null {
  224. XP!     struct dent dent;
  225. XP      int null;
  226. XP  } static_dent;
  227. XP  
  228. XP***************
  229. XP*** 234,240
  230. XP  
  231. XP      if(delta > (12L * 3600))
  232. XP      {
  233. XP!         utoda_lz(dt5,2,lt->tm_mon);
  234. XP          dt5[2] = '/';
  235. XP          utoda_lz(dt5 + 3,2,lt->tm_mday);
  236. XP      }
  237. XP
  238. XP--- 248,254 -----
  239. XP  
  240. XP      if(delta > (12L * 3600))
  241. XP      {
  242. XP!         utoda_lz(dt5,2,lt->tm_mon + 1);
  243. XP          dt5[2] = '/';
  244. XP          utoda_lz(dt5 + 3,2,lt->tm_mday);
  245. XP      }
  246. XP***************
  247. XP*** 339,345
  248. XP      utoda_lz(buf + 3,2,lt->tm_min);
  249. XP      buf[5] = ':';
  250. XP      utoda_lz(buf + 6,2,lt->tm_sec);
  251. XP!     move(0,COLS - 13);
  252. XP      addstr(buf);
  253. XP  
  254. XP  }    /* end of display_tod */
  255. XP
  256. XP--- 353,359 -----
  257. XP      utoda_lz(buf + 3,2,lt->tm_min);
  258. XP      buf[5] = ':';
  259. XP      utoda_lz(buf + 6,2,lt->tm_sec);
  260. XP!     move(0,COLS - 18);
  261. XP      addstr(buf);
  262. XP  
  263. XP  }    /* end of display_tod */
  264. XP***************
  265. XP*** 458,464
  266. XP  int itmp;
  267. XP  int retry_count;
  268. XP  int status;
  269. XP! int queue_count;
  270. XP  char *stattxt;
  271. XP  int locking_pid;
  272. XP  char *ttyname;
  273. XP
  274. XP--- 472,479 -----
  275. XP  int itmp;
  276. XP  int retry_count;
  277. XP  int status;
  278. XP! int input_queue_count;
  279. XP! int output_queue_count;
  280. XP  char *stattxt;
  281. XP  int locking_pid;
  282. XP  char *ttyname;
  283. XP***************
  284. XP*** 485,491
  285. XP      strcpy(work_dir,WORKDIR);
  286. XP      strcat(work_dir,system_name);
  287. XP  
  288. XP!     queue_count = 0;
  289. XP      if(work_dp = dir_open(work_dir))
  290. XP      {
  291. XP          /* count the number of C. queue_count */
  292. XP
  293. XP--- 500,507 -----
  294. XP      strcpy(work_dir,WORKDIR);
  295. XP      strcat(work_dir,system_name);
  296. XP  
  297. XP!     input_queue_count = 0;
  298. XP!     output_queue_count = 0;
  299. XP      if(work_dp = dir_open(work_dir))
  300. XP      {
  301. XP          /* count the number of C. output_queue_count */
  302. XP***************
  303. XP*** 488,494
  304. XP      queue_count = 0;
  305. XP      if(work_dp = dir_open(work_dir))
  306. XP      {
  307. XP!         /* count the number of C. queue_count */
  308. XP          while(dp = dir_read(work_dp))
  309. XP          {
  310. XP              if(!strncmp(dp->d_name,"C.",2))
  311. XP
  312. XP--- 504,510 -----
  313. XP      output_queue_count = 0;
  314. XP      if(work_dp = dir_open(work_dir))
  315. XP      {
  316. XP!         /* count the number of C. output_queue_count */
  317. XP          while(dp = dir_read(work_dp))
  318. XP          {
  319. XP              if(!strncmp(dp->d_name,"X.",2) && (input_queue_count <= 99))
  320. XP***************
  321. XP*** 491,499
  322. XP          /* count the number of C. queue_count */
  323. XP          while(dp = dir_read(work_dp))
  324. XP          {
  325. XP!             if(!strncmp(dp->d_name,"C.",2))
  326. XP!                 queue_count++;
  327. XP!             if(queue_count > 99)
  328. XP                  break;
  329. XP          }
  330. XP          dir_close(work_dp);
  331. XP
  332. XP--- 507,517 -----
  333. XP          /* count the number of C. output_queue_count */
  334. XP          while(dp = dir_read(work_dp))
  335. XP          {
  336. XP!             if(!strncmp(dp->d_name,"X.",2) && (input_queue_count <= 99))
  337. XP!                 input_queue_count++;
  338. XP!             if(!strncmp(dp->d_name,"C.",2) && (output_queue_count <= 99))
  339. XP!                 output_queue_count++;
  340. XP!             if((input_queue_count > 99) && (output_queue_count > 99))
  341. XP                  break;
  342. XP          }
  343. XP          dir_close(work_dp);
  344. XP***************
  345. XP*** 518,524
  346. XP          s32[10] = 0;
  347. XP      addstr(s32);
  348. XP  
  349. XP!     move(y,RCNT_X);
  350. XP      if(retry_count)
  351. XP      {
  352. XP          if(retry_count > 999)
  353. XP
  354. XP--- 536,542 -----
  355. XP          s32[10] = 0;
  356. XP      addstr(s32);
  357. XP  
  358. XP!     move(y,CALLS_X);
  359. XP      if(retry_count)
  360. XP      {
  361. XP          if(retry_count > 999)
  362. XP***************
  363. XP*** 529,536
  364. XP      else
  365. XP          addstr("   ");
  366. XP  
  367. XP!     move(y,QCNT_X);
  368. XP!     if(queue_count)
  369. XP      {
  370. XP          if(queue_count > 99)
  371. XP              addstr(">99");
  372. XP
  373. XP--- 547,554 -----
  374. XP      else
  375. XP          addstr("   ");
  376. XP  
  377. XP!     move(y,OUTQ_X);
  378. XP!     if(output_queue_count)
  379. XP      {
  380. XP          if(output_queue_count > 99)
  381. XP              addstr(">99");
  382. XP***************
  383. XP*** 532,538
  384. XP      move(y,QCNT_X);
  385. XP      if(queue_count)
  386. XP      {
  387. XP!         if(queue_count > 99)
  388. XP              addstr(">99");
  389. XP          else
  390. XP          {
  391. XP
  392. XP--- 550,556 -----
  393. XP      move(y,OUTQ_X);
  394. XP      if(output_queue_count)
  395. XP      {
  396. XP!         if(output_queue_count > 99)
  397. XP              addstr(">99");
  398. XP          else
  399. XP          {
  400. XP***************
  401. XP*** 536,542
  402. XP              addstr(">99");
  403. XP          else
  404. XP          {
  405. XP!             utoda(s32,3,queue_count);
  406. XP              addstr(s32);
  407. XP          }
  408. XP      }
  409. XP
  410. XP--- 554,560 -----
  411. XP              addstr(">99");
  412. XP          else
  413. XP          {
  414. XP!             utoda(s32,3,output_queue_count);
  415. XP              addstr(s32);
  416. XP          }
  417. XP      }
  418. XP***************
  419. XP*** 543,548
  420. XP      else
  421. XP          addstr("   ");
  422. XP  
  423. XP      move(y,LAST_X);
  424. XP      addstr(datetime5(secs_last_try));
  425. XP  
  426. XP
  427. XP--- 561,580 -----
  428. XP      else
  429. XP          addstr("   ");
  430. XP  
  431. XP+     move(y,INPQ_X);
  432. XP+     if(input_queue_count)
  433. XP+     {
  434. XP+         if(input_queue_count > 99)
  435. XP+             addstr(">99");
  436. XP+         else
  437. XP+         {
  438. XP+             utoda(s32,3,input_queue_count);
  439. XP+             addstr(s32);
  440. XP+         }
  441. XP+     }
  442. XP+     else
  443. XP+         addstr("   ");
  444. XP+ 
  445. XP      move(y,LAST_X);
  446. XP      addstr(datetime5(secs_last_try));
  447. XP  
  448. XP***************
  449. XP*** 687,693
  450. XP  char *sysname;
  451. XP  char *cptr;
  452. XP  
  453. XP! static char *header  = 
  454. XP      "tty  raw  can   out   speed  state iflag  oflag  cflag  lflag  pgrp";
  455. XP  static char *hyphens =
  456. XP      "---  ---  ---  -----  -----  ----- ------ ------ ------ ------ -----";
  457. XP
  458. XP--- 719,725 -----
  459. XP  char *sysname;
  460. XP  char *cptr;
  461. XP  
  462. XP! static char *header  =
  463. XP      "tty  raw  can   out   speed  state iflag  oflag  cflag  lflag  pgrp";
  464. XP  static char *hyphens =
  465. XP      "---  ---  ---  -----  -----  ----- ------ ------ ------ ------ -----";
  466. XP***************
  467. XP*** 881,887
  468. XP      standend();
  469. XP  
  470. XP      move(2,0);
  471. XP!     addstr(" # SYSTEM     RCNT QCNT LAST  NEXT   PID  STATUS");
  472. XP      move(3,0);
  473. XP      addstr("-- ------     ---- ---- ----  ----   ---  ------");
  474. XP      while(1)
  475. XP
  476. XP--- 913,920 -----
  477. XP      standend();
  478. XP  
  479. XP      move(2,0);
  480. XP!     addstr(
  481. XP!     " # SYSTEM    CALLS OUTQ INPQ LAST  NEXT  PID   STATUS");
  482. XP      move(3,0);
  483. XP      addstr(
  484. XP      "-- ------    ----- ---- ---- ----- ----- ----- ------------------------");
  485. XP***************
  486. XP*** 883,889
  487. XP      move(2,0);
  488. XP      addstr(" # SYSTEM     RCNT QCNT LAST  NEXT   PID  STATUS");
  489. XP      move(3,0);
  490. XP!     addstr("-- ------     ---- ---- ----  ----   ---  ------");
  491. XP      while(1)
  492. XP      {
  493. XP          uucico_active = 0;        /* assume no uucico_active connections */
  494. XP
  495. XP--- 916,923 -----
  496. XP      addstr(
  497. XP      " # SYSTEM    CALLS OUTQ INPQ LAST  NEXT  PID   STATUS");
  498. XP      move(3,0);
  499. XP!     addstr(
  500. XP!     "-- ------    ----- ---- ---- ----- ----- ----- ------------------------");
  501. XP      while(1)
  502. XP      {
  503. XP          uucico_active = 0;        /* assume no uucico_active connections */
  504. XP*** patched_to_3/wintty.c    Sat Jan 27 19:33:18 1990
  505. XP--- wintty.c    Thu Dec 28 13:37:58 1989
  506. XP***************
  507. XP*** 1,4
  508. XP! /* CHK=0xED50 */
  509. XP  /*+-------------------------------------------------------------------------
  510. XP      wintty.c
  511. XP      ...!gatech!emory!tridom!wht
  512. XP
  513. XP--- 1,4 -----
  514. XP! /* CHK=0x957F */
  515. XP  /*+-------------------------------------------------------------------------
  516. XP      wintty.c
  517. XP      ...!gatech!emory!tridom!wht
  518. XP***************
  519. XP*** 17,22
  520. XP  
  521. XP  --------------------------------------------------------------------------*/
  522. XP  /*+:EDITS:*/
  523. XP  /*:12-21-1989-15:18-wht-display CTSFLOW and RTSFLOW if defined */
  524. XP  /*:12-04-1989-15:40-wht-creation */
  525. XP  
  526. XP
  527. XP--- 17,23 -----
  528. XP  
  529. XP  --------------------------------------------------------------------------*/
  530. XP  /*+:EDITS:*/
  531. XP+ /*:12-28-1989-13:35-wht-B600 added */
  532. XP  /*:12-21-1989-15:18-wht-display CTSFLOW and RTSFLOW if defined */
  533. XP  /*:12-04-1989-15:40-wht-creation */
  534. XP  
  535. XP***************
  536. XP*** 146,151
  537. XP      " 4800",    B4800,
  538. XP      "  300",    B300,
  539. XP      "  110",    B110,
  540. XP      "   75",    B75,
  541. XP      "   50",    B50,
  542. XP      "  HUP",    B0,
  543. XP
  544. XP--- 147,153 -----
  545. XP      " 4800",    B4800,
  546. XP      "  300",    B300,
  547. XP      "  110",    B110,
  548. XP+     "  600",    B600,
  549. XP      "   75",    B75,
  550. XP      "   50",    B50,
  551. XP      "  HUP",    B0,
  552. XDIFF_EOF
  553. Xecho 'Patch 3 applied.'
  554. Xexit 0
  555. SHAR_EOF
  556. chmod 0755 PATCH.4 || echo "restore of PATCH.4 fails"
  557. if [ $TOUCH = can ]
  558. then
  559.     touch -m 0127194790 PATCH.4
  560. fi
  561. exit 0
  562.  
  563.