lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev NSL_FORK child and signals


From: Klaus Weide
Subject: lynx-dev NSL_FORK child and signals
Date: Fri, 4 Dec 1998 23:24:41 -0600 (CST)

The NSL_FORK child process should not run any signal handlers the parent
may have installed.  An indication that this currently happens: when ^C
is pressed during a lookup, the line

   Exiting via interrupt: 2

appears twice.  That probably means that two processes are competing to
remove temp files, flushing/closing the trace file, write the cookie file,
and do other cleanup stuff.

Patch against 2.8.1rel.2, should also work for devel code.

*** lynx2-8-1.orig/WWW/Library/Implementation/HTTCP.c   Sat Oct 24 11:49:07 1998
--- lynx2-8-1/WWW/Library/Implementation/HTTCP.c        Fri Dec  4 23:09:19 1998
***************
*** 21,26 ****
--- 21,27 ----
  #include <HTParse.h>
  #include <HTAlert.h>
  #include <HTTCP.h>
+ #include <LYGlobalDefs.h>     /* added for no_suspend */
  #include <LYUtils.h>
  
  #ifdef NSL_FORK
***************
*** 479,484 ****
--- 480,513 ----
                **  Make sure parent can kill us at will.  -BL
                */
                (void) signal(SIGTERM, quench);
+ 
+               /*
+               **  Also make sure the child does not run one of the
+               **  signal handlers that may have been installed by
+               **  Lynx if one of those signals occurs.  For example
+               **  we don't want the child to remove temp files on
+               **  ^C, let the parent deal with that. - kw
+               */
+               (void) signal(SIGINT, quench);
+ #ifndef NOSIGHUP
+               (void) signal(SIGHUP, quench);
+ #endif /* NOSIGHUP */
+ #ifdef SIGTSTP
+               if (no_suspend)
+                   (void) signal(SIGTSTP, SIG_IGN);
+               else
+                   (void) signal(SIGTSTP, SIG_DFL);
+ #endif /* SIGTSTP */
+ #ifdef SIGWINCH
+               (void) signal(SIGWINCH, SIG_IGN);
+ #endif /* SIGWINCH */
+ #ifndef __linux__
+ #ifndef DOSPATH
+               signal(SIGBUS, SIG_DFL);
+ #endif /* DOSPATH */
+ #endif /* !__linux__ */
+               signal(SIGSEGV, SIG_DFL);
+               signal(SIGILL, SIG_DFL);
  
                /*
                **  Child won't use read side.  -BL

reply via email to

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