lynx-dev
[Top][All Lists]
Advanced

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

LYNX-DEV More on SIGINT for DOS


From: Doug Kaufman
Subject: LYNX-DEV More on SIGINT for DOS
Date: Wed, 28 Jan 1998 23:42:43 -0800 (PST)

The following patch replaces the one I previously posted regarding CTL-C
and CTL-BREAK handling in the lynx DOS port.  The previous  patch
changed LYMain.c and LYexit.c. The changes here are all in LYMain.c and
the patch seems cleaner.  The behavior is similar: it allows  exiting
from lynx via SIGINT by pressing CTL-C or CTL-BREAK, regardless of the
DOS BREAK setting. It leaves the BREAK setting unchanged unless CTL-C or
CTL-BREAK is actually pressed (in which case BREAK is left ON).

In regard to posted questions about the traceback printing on exiting
via SIGINT, the following is quoted from the DJGPP libc info file.

>The default handling for all the signals is to print a traceback (a
>stack dump which describes the sequence of function calls leading to the
>generation of the signal) and abort the program.
                                Doug


*** lynx2-7-1/src/LYMain.c      Fri Jan 16 10:29:28 1998
--- lynx2-7-1/src/LYMain.c.new  Wed Jan 28 22:41:46 1998
***************
*** 66,71 ****
--- 66,75 ----
  PUBLIC BOOLEAN sigint = FALSE;
  #endif /* IGNORE_CTRL_C */
  
+ #ifdef __DJGPP__
+ char init_ctrl_break[1];
+ #endif /* __DJGPP__ */
+ 
  #ifdef VMS
  PUBLIC char *mail_adrs = NULL;        /* the mask for a VMS mail transport */
               /* create FIXED 512 binaries */
***************
*** 397,402 ****
--- 401,413 ----
  #if defined(USE_HASH)
      char *lynx_lss_file=NULL;
  #endif
+     
+ #ifdef __DJGPP__
+ void  reset_break() 
+ {
+     PDC_set_ctrl_break(init_ctrl_break[0]);
+ }
+ #endif /* __DJGPP__ */
  
  PRIVATE void free_lynx_globals NOARGS
  {
***************
*** 546,552 ****
      }
  #endif /* _WINDOWS */
  
! #ifdef DJGPP
      sock_init();
  #endif
  
--- 557,568 ----
      }
  #endif /* _WINDOWS */
  
! #ifdef __DJGPP__
! if (PDC_get_ctrl_break() == 0) {
!     PDC_set_ctrl_break(TRUE);
!     init_ctrl_break[0] = 0;}
! else {init_ctrl_break[0] = 1;}
!     atexit(reset_break);
      sock_init();
  #endif
  

__
Doug Kaufman
Internet: address@hidden (preferred)
          address@hidden

reply via email to

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