home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume10 / siotools / patch06 < prev    next >
Text File  |  1990-02-20  |  13KB  |  461 lines

  1. Newsgroups: comp.sources.misc
  2. subject: v10i076: siotools v09i044/45 patch 6
  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 76
  7. Submitted-by: wht%n4hgf@gatech.edu (Warren Tucker)
  8. Archive-name: siotools/patch06
  9.  
  10. This is siotools v09i044/v09i45 Patch 6.  This program has been very
  11. popular and I appreciate the help from m2xenix!news, stratton@hpda.hp.com
  12. and xroads!jerry for help getting the various SCO development systems to
  13. produce working code.
  14.  
  15. On Feb 16, 23:36, Randy Bush (mpxenix!news) wrote:
  16. @ I applied patch 5, ran uusnap, and after exiting with 'q', if I typed a
  17. @ line to csh and hit return, the cursor went back to the beginning of
  18. @ the prompt line and nothing happened (csh did not get command).
  19. @ I may learn more later,
  20. @ randy
  21.  
  22. On Feb 17, 14:36, Randy Bush (mpxenix!news) wrote:
  23. @ So I went back a rev, and still got the same result.
  24. @ It seems to be suddenly leaving my terminal in a pretty raw mode, <backspace>
  25. @ generates ^H, <return> generates ^M as opposed to <end-of-line>, but ^J works
  26. @ for eol.  Hmmm.
  27. @ randy
  28.  
  29. I seem to have invoked curses revision rot somehow.  I put out the patch
  30. to fix a problem reported with XENIX development system 2.3.2.  I had no
  31. problems with the old code on my SCO UNIX system or on a 386 with XENIX
  32. development system 2.3.1.  Now, 2.3.2 handles it properly and you have
  33. trouble.  Hmmmm is right.  Net, please forgive me for this crock I
  34. am about to perpetrate, but I believe it will Fix this problem once
  35. and for all.  If I was doing something wrong, please TELL me.
  36.  
  37. #!/bin/sh
  38. # This is siotools.p6, a shell archive (shar 3.04)
  39. # made 02/18/1990 08:50 UTC by gatech!kd4nc!n4hgf!wht (wht%n4hgf@gatech.edu)
  40. # Source directory /u4/src/siotools/rel
  41. #
  42. # existing files WILL be overwritten
  43. #
  44. # This shar contains:
  45. #    PATCH.6
  46. #
  47. touch 2>&1 | fgrep '[-amc]' > /tmp/s3_touch$$
  48. if [ -s /tmp/s3_touch$$ ]
  49. then
  50.     TOUCH=can
  51. else
  52.     TOUCH=cannot
  53. fi
  54. rm -f /tmp/s3_touch$$
  55. echo "x - extracting PATCH.6 (Text)"
  56. sed 's/^X//' << 'SHAR_EOF' > PATCH.6 &&
  57. X:
  58. X#-----------------------------------------------------------------------
  59. X# siotools v09i044/v09i45 Patch 6
  60. X# fix problems with some curses versions not restoring console tty
  61. X# upon exit.
  62. X#-----------------------------------------------------------------------
  63. X
  64. Xsed -e 's/^P//' << DIFF_EOF | patch
  65. XP*** rel/siomon.c    Tue Feb 13 14:39:50 1990
  66. XP--- siomon.c    Sun Feb 18 03:44:02 1990
  67. XP***************
  68. XP*** 1,5
  69. XP  /* CHK=0x75B9 */
  70. XP! char *revision = "1.35";
  71. XP  /*+-------------------------------------------------------------------------
  72. XP      siomon.c -- watch XENIX/UNIX serial I/O
  73. XP      ...!gatech!kd4nc!n4hgf!wht
  74. XP
  75. XP--- 1,5 -----
  76. XP  /* CHK=0x75B9 */
  77. XP! char *revision = "1.36";
  78. XP  /*+-------------------------------------------------------------------------
  79. XP      siomon.c -- watch XENIX/UNIX serial I/O
  80. XP      ...!gatech!kd4nc!n4hgf!wht
  81. XP***************
  82. XP*** 47,52
  83. XP      leave()
  84. XP      main(argc,argv,envp)
  85. XP      main_template()
  86. XP  
  87. XP    Kudos to pyrnj.pyramid.com!romain (Romain Kang) for many suggestions
  88. XP    regarding screen and CPU efficiency in the original itpmon.c for Pyramid
  89. XP
  90. XP--- 47,54 -----
  91. XP      leave()
  92. XP      main(argc,argv,envp)
  93. XP      main_template()
  94. XP+     my_savetty()
  95. XP+     my_resetty()
  96. XP  
  97. XP    Kudos to pyrnj.pyramid.com!romain (Romain Kang) for many suggestions
  98. XP    regarding screen and CPU efficiency in the original itpmon.c for Pyramid
  99. XP***************
  100. XP*** 50,55
  101. XP  
  102. XP    Kudos to pyrnj.pyramid.com!romain (Romain Kang) for many suggestions
  103. XP    regarding screen and CPU efficiency in the original itpmon.c for Pyramid
  104. XP  --------------------------------------------------------------------------*/
  105. XP  /*+:EDITS:*/
  106. XP  /*:12-28-1989-13:35-wht-change rev - B600 added to wintty */
  107. XP
  108. XP--- 52,59 -----
  109. XP  
  110. XP    Kudos to pyrnj.pyramid.com!romain (Romain Kang) for many suggestions
  111. XP    regarding screen and CPU efficiency in the original itpmon.c for Pyramid
  112. XP+   Thanks to mpxenix!news (Randy Bush) for tireless help with a curses
  113. XP+   bug hopefully now retired, even if it crockish.
  114. XP  --------------------------------------------------------------------------*/
  115. XP  /*+:EDITS:*/
  116. XP  /*:02-18-1990-03:29-wht-bug in curses tty mode handling - force a fix */
  117. XP***************
  118. XP*** 52,57
  119. XP    regarding screen and CPU efficiency in the original itpmon.c for Pyramid
  120. XP  --------------------------------------------------------------------------*/
  121. XP  /*+:EDITS:*/
  122. XP  /*:12-28-1989-13:35-wht-change rev - B600 added to wintty */
  123. XP  /*:12-21-1989-15:20-wht-version number chg - CTSFLOW/RTSFLOW */
  124. XP  /*:12-04-1989-16:45-wht-add more to detail */
  125. XP
  126. XP--- 56,62 -----
  127. XP    bug hopefully now retired, even if it crockish.
  128. XP  --------------------------------------------------------------------------*/
  129. XP  /*+:EDITS:*/
  130. XP+ /*:02-18-1990-03:29-wht-bug in curses tty mode handling - force a fix */
  131. XP  /*:12-28-1989-13:35-wht-change rev - B600 added to wintty */
  132. XP  /*:12-21-1989-15:20-wht-version number chg - CTSFLOW/RTSFLOW */
  133. XP  /*:12-04-1989-16:45-wht-add more to detail */
  134. XP***************
  135. XP*** 98,103
  136. XP  struct utsname me;
  137. XP  
  138. XP  /*+-------------------------------------------------------------------------
  139. XP      leave() - terminate curses, reset terminal and exit
  140. XP  --------------------------------------------------------------------------*/
  141. XP  void
  142. XP
  143. XP--- 103,121 -----
  144. XP  struct utsname me;
  145. XP  
  146. XP  /*+-------------------------------------------------------------------------
  147. XP+     workaround curses tty handling difficulties among different revs
  148. XP+ --------------------------------------------------------------------------*/
  149. XP+ struct termio my_termio_crock;
  150. XP+ void my_savetty()    /* used in lieu of savetty() */
  151. XP+ {
  152. XP+     ioctl(0,TCGETA,&my_termio_crock);
  153. XP+ }
  154. XP+ void my_resetty()    /* used in lieu of resetty() and endwin() */
  155. XP+ {
  156. XP+     ioctl(0,TCSETA,&my_termio_crock);
  157. XP+ }
  158. XP+ 
  159. XP+ /*+-------------------------------------------------------------------------
  160. XP      leave() - terminate curses, reset terminal and exit
  161. XP  --------------------------------------------------------------------------*/
  162. XP  void
  163. XP***************
  164. XP*** 103,109
  165. XP  void
  166. XP  leave()
  167. XP  {
  168. XP!     if(!stdscr)
  169. XP      {
  170. XP          resetty();
  171. XP          exit(0);
  172. XP
  173. XP--- 121,127 -----
  174. XP  void
  175. XP  leave()
  176. XP  {
  177. XP!     if(stdscr)
  178. XP      {
  179. XP          move(LINES - 1,0);
  180. XP          refresh();
  181. XP***************
  182. XP*** 105,111
  183. XP  {
  184. XP      if(!stdscr)
  185. XP      {
  186. XP!         resetty();
  187. XP          exit(0);
  188. XP      }
  189. XP      move(LINES - 1,0);
  190. XP
  191. XP--- 123,131 -----
  192. XP  {
  193. XP      if(stdscr)
  194. XP      {
  195. XP!         move(LINES - 1,0);
  196. XP!         refresh();
  197. XP!         my_resetty();
  198. XP          exit(0);
  199. XP      }
  200. XP  }    /* end of leave */
  201. XP***************
  202. XP*** 108,117
  203. XP          resetty();
  204. XP          exit(0);
  205. XP      }
  206. XP-     move(LINES - 1,0);
  207. XP-     refresh();
  208. XP-     endwin();
  209. XP-     exit(0);
  210. XP  }    /* end of leave */
  211. XP  
  212. XP  /*+-------------------------------------------------------------------------
  213. XP
  214. XP--- 128,133 -----
  215. XP          my_resetty();
  216. XP          exit(0);
  217. XP      }
  218. XP  }    /* end of leave */
  219. XP  
  220. XP  /*+-------------------------------------------------------------------------
  221. XP***************
  222. XP*** 422,432
  223. XP      uname(&me);
  224. XP  
  225. XP      setbuf(stdout,_sobuf);
  226. XP!     initscr();
  227. XP!     savetty();
  228. XP!     crmode();
  229. XP!     noecho();
  230. XP!     if(!stdscr)
  231. XP      {
  232. XP          fprintf(stderr,"curses init failed\n");
  233. XP          resetty();
  234. XP
  235. XP--- 438,445 -----
  236. XP      uname(&me);
  237. XP  
  238. XP      setbuf(stdout,_sobuf);
  239. XP!     my_savetty();
  240. XP!     if(!initscr())
  241. XP      {
  242. XP          fputs("curses init failed ... check terminal type\n",stderr);
  243. XP          exit(1);
  244. XP***************
  245. XP*** 428,435
  246. XP      noecho();
  247. XP      if(!stdscr)
  248. XP      {
  249. XP!         fprintf(stderr,"curses init failed\n");
  250. XP!         resetty();
  251. XP          exit(1);
  252. XP      }
  253. XP      main_template();
  254. XP
  255. XP--- 441,447 -----
  256. XP      my_savetty();
  257. XP      if(!initscr())
  258. XP      {
  259. XP!         fputs("curses init failed ... check terminal type\n",stderr);
  260. XP          exit(1);
  261. XP      }
  262. XP      crmode();
  263. XP***************
  264. XP*** 432,437
  265. XP          resetty();
  266. XP          exit(1);
  267. XP      }
  268. XP      main_template();
  269. XP  
  270. XP      move(4,0);
  271. XP
  272. XP--- 444,451 -----
  273. XP          fputs("curses init failed ... check terminal type\n",stderr);
  274. XP          exit(1);
  275. XP      }
  276. XP+     crmode();
  277. XP+     noecho();
  278. XP      main_template();
  279. XP  
  280. XP      move(4,0);
  281. XP*** rel/uusnap.c    Tue Feb 13 14:39:51 1990
  282. XP--- uusnap.c    Sun Feb 18 03:40:26 1990
  283. XP***************
  284. XP*** 1,5
  285. XP  /* CHK=0xBF8D */
  286. XP! char *revision = "1.73";
  287. XP  /*+-------------------------------------------------------------------------
  288. XP      uusnap.c - display UUCP communications status for HDB systems
  289. XP      ...gatech!kd4nc!n4hgf!wht
  290. XP
  291. XP--- 1,5 -----
  292. XP  /* CHK=0xBF8D */
  293. XP! char *revision = "1.74";
  294. XP  /*+-------------------------------------------------------------------------
  295. XP      uusnap.c - display UUCP communications status for HDB systems
  296. XP      ...gatech!kd4nc!n4hgf!wht
  297. XP***************
  298. XP*** 21,26
  299. XP      get_status_info(system_name,buf,bufsize)
  300. XP      lockpid_to_tty(lockpid)
  301. XP      main(argc,argv)
  302. XP      spooldirname(fname)
  303. XP      statdirname(fname)
  304. XP  
  305. XP
  306. XP--- 21,28 -----
  307. XP      get_status_info(system_name,buf,bufsize)
  308. XP      lockpid_to_tty(lockpid)
  309. XP      main(argc,argv)
  310. XP+     my_savetty()
  311. XP+     my_resetty()
  312. XP      spooldirname(fname)
  313. XP      statdirname(fname)
  314. XP  
  315. XP***************
  316. XP*** 40,45
  317. XP   2 n4vu                      19:07 19:07       successful
  318. XP   3 tridom                 1  19:17 19:17       TALKING (tty2e)
  319. XP   4 ki4xo                     01/25 01/25       successful
  320. XP  --------------------------------------------------------------------------*/
  321. XP  /*+:EDITS:*/
  322. XP  /*:02-07-1990-16:34-wht-use crmode and nocrmode rather than raw and noraw */
  323. XP
  324. XP--- 42,51 -----
  325. XP   2 n4vu                      19:07 19:07       successful
  326. XP   3 tridom                 1  19:17 19:17       TALKING (tty2e)
  327. XP   4 ki4xo                     01/25 01/25       successful
  328. XP+ 
  329. XP+ 
  330. XP+  Thanks to mpxenix!news (Randy Bush) for tireless help with a curses
  331. XP+  bug hopefully now retired, even if it crockish.
  332. XP  --------------------------------------------------------------------------*/
  333. XP  /*+:EDITS:*/
  334. XP  /*:02-18-1990-03:29-wht-bug in curses tty mode handling - force a fix */
  335. XP***************
  336. XP*** 42,47
  337. XP   4 ki4xo                     01/25 01/25       successful
  338. XP  --------------------------------------------------------------------------*/
  339. XP  /*+:EDITS:*/
  340. XP  /*:02-07-1990-16:34-wht-use crmode and nocrmode rather than raw and noraw */
  341. XP  /*:01-27-1990-19:11-wht-show input and output queues + cosmetics */
  342. XP  /*:12-28-1989-13:35-wht-change rev - B600 added to wintty */
  343. XP
  344. XP--- 48,54 -----
  345. XP   bug hopefully now retired, even if it crockish.
  346. XP  --------------------------------------------------------------------------*/
  347. XP  /*+:EDITS:*/
  348. XP+ /*:02-18-1990-03:29-wht-bug in curses tty mode handling - force a fix */
  349. XP  /*:02-07-1990-16:34-wht-use crmode and nocrmode rather than raw and noraw */
  350. XP  /*:01-27-1990-19:11-wht-show input and output queues + cosmetics */
  351. XP  /*:12-28-1989-13:35-wht-change rev - B600 added to wintty */
  352. XP***************
  353. XP*** 186,191
  354. XP  #endif
  355. XP  
  356. XP  /*+-------------------------------------------------------------------------
  357. XP      dir_open(dirname)
  358. XP  --------------------------------------------------------------------------*/
  359. XP  DDIR *
  360. XP
  361. XP--- 193,211 -----
  362. XP  #endif
  363. XP  
  364. XP  /*+-------------------------------------------------------------------------
  365. XP+     workaround curses tty handling difficulties among different revs
  366. XP+ --------------------------------------------------------------------------*/
  367. XP+ struct termio my_termio_crock;
  368. XP+ void my_savetty()    /* used in lieu of savetty() */
  369. XP+ {
  370. XP+     ioctl(0,TCGETA,&my_termio_crock);
  371. XP+ }
  372. XP+ void my_resetty()    /* used in lieu of resetty() and endwin() */
  373. XP+ {
  374. XP+     ioctl(0,TCSETA,&my_termio_crock);
  375. XP+ }
  376. XP+ 
  377. XP+ /*+-------------------------------------------------------------------------
  378. XP      dir_open(dirname)
  379. XP  --------------------------------------------------------------------------*/
  380. XP  DDIR *
  381. XP***************
  382. XP*** 376,382
  383. XP          nocrmode();
  384. XP          move(LINES - 1,0);
  385. XP          refresh();
  386. XP!         endwin();
  387. XP      }
  388. XP      exit(0);
  389. XP  }    /* end of bye */
  390. XP
  391. XP--- 396,402 -----
  392. XP          nocrmode();
  393. XP          move(LINES - 1,0);
  394. XP          refresh();
  395. XP!         my_resetty();
  396. XP      }
  397. XP      exit(0);
  398. XP  }    /* end of bye */
  399. XP***************
  400. XP*** 735,741
  401. XP      getyx(stdscr,y,x);
  402. XP      move(y,x - 2);
  403. XP      refresh();
  404. XP!     resetty();
  405. XP      x = scanw("%d",&sysdetail);
  406. XP      crmode();
  407. XP      noecho();
  408. XP
  409. XP--- 755,762 -----
  410. XP      getyx(stdscr,y,x);
  411. XP      move(y,x - 2);
  412. XP      refresh();
  413. XP!     nocrmode();
  414. XP!     echo();
  415. XP      x = scanw("%d",&sysdetail);
  416. XP      crmode();
  417. XP      noecho();
  418. XP***************
  419. XP*** 861,866
  420. XP  
  421. XP      setbuf(stdout,_sobuf);
  422. XP  
  423. XP      if(!initscr())
  424. XP      {
  425. XP          fprintf(stderr,"curses init failed... check terminal type\n");
  426. XP
  427. XP--- 882,888 -----
  428. XP  
  429. XP      setbuf(stdout,_sobuf);
  430. XP  
  431. XP+     my_savetty();
  432. XP      if(!initscr())
  433. XP      {
  434. XP          fprintf(stderr,"curses init failed... check terminal type\n");
  435. XP***************
  436. XP*** 866,872
  437. XP          fprintf(stderr,"curses init failed... check terminal type\n");
  438. XP          exit(0);
  439. XP      }
  440. XP-     savetty();
  441. XP      noecho();
  442. XP      crmode();
  443. XP  
  444. XP
  445. XP--- 888,893 -----
  446. XP          fprintf(stderr,"curses init failed... check terminal type\n");
  447. XP          exit(0);
  448. XP      }
  449. XP      noecho();
  450. XP      crmode();
  451. XP  
  452. XDIFF_EOF
  453. SHAR_EOF
  454. chmod 0755 PATCH.6 || echo "restore of PATCH.6 fails"
  455. if [ $TOUCH = can ]
  456. then
  457.     touch -m 0218034890 PATCH.6
  458. fi
  459. exit 0
  460.  
  461.