lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LYNX-DEV Re: DIRED mods - crash fix


From: Klaus Weide
Subject: LYNX-DEV Re: DIRED mods - crash fix
Date: Sun, 17 Nov 1996 05:54:19 -0600 (CST)

On Sun, 17 Nov 1996, Nelson Henry Eric wrote:

[kweide:]
> > I will try to reproduce your fatal errors.  Let me know if you can
> > narrow down when they occur.
> 
> It seems to be getting wider as I try new things.  When I tried to
> create a new file outside of $HOME, lynx crashed:
> 
> touch: cannot create /home/kyoin/nelsonhe/../testing: Permission denied
>                                  ^^^^^^^^^^^
> 
> Is sunos going to like that extra stuff in there?  

That shouldn't be a problem.

The reason for the crashes: the my_spawn() function in LYLocal.c was
calling statusline() while stop_curses() was in effect.  [It could be
that only slang curses is especially sensitive to that.]  This happened
whenever an execv'd command failed.

Below is a fix to prevent that.

> But, I just now remembered that I only have your original patch on without
> the mods made by Fote.  It'll have to be next weekend, but I'll try to
> download Hiram's latest set, and test with that.

I compared the file LYLocal.c, as it appears in Hiram's composite update,
with my version of it.  I didn't see any other significant changes, but a
change of one line (it was deleted by my patch) was somehow missing from
Hiram's.  (No big deal, but if you tried to move several tagged files
the even-numbered files would probably be skipped.)  The first chunk
of the below diffs fixes that omission, relative to Hiram's set. 
So to apply these diffs to a version of LYLocal.c that is not from
this weekend's Composite Patches, first delete the first chunk. (Or just
let the first chunk fail when using patch, but DON'T answer yes if
patch asks whether you want to reverse the patches...)


*** lynx2-6/src/LYLocal.c.prev  Sat Nov 16 00:52:48 1996
--- lynx2-6/src/LYLocal.c       Sun Nov 17 05:13:48 1996
***************
*** 381,387 ****
               args[3] = (char *) 0;
               if (my_spawn(MV_PATH, args, tmpbuf) <= 0)
                  break;
-              tag = tag->next;
               ++count;
            }
            FREE(srcpath);
--- 381,386 ----
***************
*** 1656,1668 ****
  #endif /* NeXT || AIX4 || sony_news */
  
      rc = 1;                 /* It will work */
      stop_curses();
      pid = fork(); /* fork and execute rm */
      switch (pid) {
        case -1:
        sprintf(tmpbuf, "Unable to %s due to system error!", msg);
-       _statusline(tmpbuf);
-       sleep(AlertSecs);
        rc = 0;
        break;                  /* don't fall thru! - KW */
        case 0:  /* child */
--- 1655,1666 ----
  #endif /* NeXT || AIX4 || sony_news */
  
      rc = 1;                 /* It will work */
+     tmpbuf[0] = '\0';       /* empty buffer for alert messages */
      stop_curses();
      pid = fork(); /* fork and execute rm */
      switch (pid) {
        case -1:
        sprintf(tmpbuf, "Unable to %s due to system error!", msg);
        rc = 0;
        break;                  /* don't fall thru! - KW */
        case 0:  /* child */
***************
*** 1679,1686 ****
            WTERMSIG(wstatus) != 0)  { /* error return */
            sprintf(tmpbuf, "Probable failure to %s due to system error!",
                    msg);
-           _statusline(tmpbuf);
-           sleep(AlertSecs);
            rc = 0;
        }
      }
--- 1677,1682 ----
***************
*** 1690,1696 ****
--- 1686,1700 ----
        HadVMSInterrupt = FALSE;
      }
  #endif /* VMS */
+ 
+     if (rc==0) { /* screen may have message from the failed execv'd command */
+       sleep(AlertSecs);       /* time to look at it before screen refresh */
+     }
      start_curses();
+     if (tmpbuf[0]) {
+       _statusline(tmpbuf);
+       sleep(AlertSecs);
+     }
  
      return(rc);
  }

;
; To UNSUBSCRIBE:  Send a mail message to address@hidden
;                  with "unsubscribe lynx-dev" (without the
;                  quotation marks) on a line by itself.
;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]