home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 100-199 / ff114.lzh / Vt100 / fixes / amiga.8953 < prev    next >
Text File  |  1987-11-22  |  4KB  |  103 lines

  1. Article 8953 of comp.sys.amiga:
  2. Path: mcdsun!noao!hao!hull
  3. From: hull@hao.UCAR.EDU (Howard Hull)
  4. Newsgroups: comp.sys.amiga
  5. Subject: vt100v2.7 needs Walton-Puckett BPTR StartLock fix
  6. Keywords: recidivistic stray file locks remain after Change Dir
  7. Message-ID: <922@hao.UCAR.EDU>
  8. Date: 10 Oct 87 22:19:41 GMT
  9. Organization: High Altitude Obs./NCAR, Boulder CO
  10. Lines: 89
  11.  
  12. The comp.sources.amiga version of vt100 (V2.7 ACS 870825a) has problems
  13. with leaving behind a file lock on close.  A fix for this was offered
  14. by Ed Puckett for V2.6 based on some earlier contributions by Steve Walton.
  15. I just tried those fixes on V2.7 (now being used) and they seem to work ok.
  16. So, I'll just pluck up Puckett's article :-(*)
  17.  
  18. >From: qix@mit-prep.ARPA (Ed Puckett)
  19. >Newsgroups: comp.sys.amiga
  20. >Subject: Bug Fix - Version 2.6 VT100 Stray FileLocks
  21. >Message-ID: <48@mit-prep.ARPA>
  22. >Date: 7 Mar 87 03:03:39 GMT
  23. >Organization: The MIT AI Lab, Cambridge, MA
  24.  
  25. >    First, thanks to Dave Wecker (and all others involved) for the wonderful
  26. VT100 terminal emulator.  It's a pleasure to use, and keeps getting better!
  27.  
  28.      In article <1067@rutgers.RUTGERS.EDU>, Steve Walton describes
  29. modifications to Version 2.6 VT100 to overcome bugs in the handling of
  30. FileLocks.  With these modifications, the program no longer crashes the
  31. system after being run from the Workbench.  However, it now fails to
  32. release the last directory lock obtained, which causes free memory
  33. lossage and associated disk icons to "stick around" on the Workbench.
  34.      The solution presented here saves the original directory lock, and
  35. restores it during cleanup.  This way, your current directory is the same
  36. after as before running VT100, regardless of any directory changes made
  37. while in VT100.
  38.      I duplicate the diff format used by Steve Walton because it is so
  39. easy to use.  Apply these changes to the original files as posted by
  40. Dave Wecker [ACS for V2.7].  Delete lines marked *DEL*, and insert those
  41. marked *INS*.  Some of Steve's changes are used here.
  42.  
  43. vt100.c
  44. -------
  45.        char    MyDir[60];
  46. *DEL*  struct  FileLock *MyDirLock = NULL;
  47. *DEL*  struct  FileLock *StartLock = NULL;
  48. *INS*  BPTR    StartLock = 0;
  49.  
  50. main()...
  51.            MyDir[0]  =     '\000';
  52. *DEL*      StartLock = (struct FileLock *)((ULONG)((struct Process *)
  53. *DEL*                      (FindTask(NULL)))->pr_CurrentDir);
  54. *DEL*      MyDirLock = (struct FileLock *)DupLock(StartLock);
  55. *INS*      StartLock =     ((struct Process *) FindTask(NULL))->pr_CurrentDir;
  56. *INS*                      CurrentDir(DupLock(StartLock));
  57.  
  58. cleanup()....
  59.                CloseDevice(&Audio_Request);
  60. *DEL*          if (MyDirLock != NULL) UnLock(MyDirLock);
  61. *INS*          UnLock(CurrentDir(StartLock));     /* back to original directory */
  62.  
  63. vt100.h
  64. -------
  65.        extern char    MyDir[60];
  66. *DEL*  extern struct    FileLock *MyDirLock;
  67. *DEL*  extern struct    FileLock *StartLock;
  68. *INS*  extern BPTR    StartLock;
  69.        extern struct    IntuitionBase *IntuitionBase;
  70.        
  71. expand.c
  72. --------
  73.                       if (fib->fib_DirEntryType > 0) {
  74. *DEL*                      CurrentDir(lock);
  75. *DEL*                      if (MyDirLock != NULL) UnLock(MyDirLock);
  76. *DEL*                      MyDirLock = lock;
  77. *INS*                      UnLock(CurrentDir(lock));
  78.                            if (MyDir[strlen(MyDir)-1] == '/')
  79.  
  80. ::::::::::::::::::::::::::::::::::::::
  81. ::: Ed Puckett :::::::::::::::::::::::
  82. ::: EPAC Software ::::::::::::::::::::
  83. ::: ...!ihnp4!mit-eddie!mit-oz!qix :::
  84. ::::::::::::::::::::::::::::::::::::::
  85.  
  86. <I also noted that the comp.sources.amiga diff file posted by Tony Sumrall -
  87.  
  88.         Subject: Late breaking fixes to VT100 R2.7
  89.         Message-ID: <15638@amdahl.amdahl.com>
  90.         Date: 6 Oct 87 01:01:03 GMT
  91.  
  92. should not have had fixes for the README file in the comp.sources.amiga shar,
  93. as it was already current.  The diffs for init.c and script.c _were_ needed,
  94. though.
  95.                         Best Regards, Howard Hull
  96. -eom-
  97.  
  98. Competition often does not produce the best product.  Competition usually
  99. produces the most pervasive product.  Cooperation produces the best product.
  100. "At least he got Ice Man before he got us..." Top Gun: 2 losers 0 winners.
  101.  
  102.  
  103.