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:26:38 -0800 (PST)

The following patch regarding  CTL-C and CTL-BREAK handling in lynx
for DOS replaces the patch I previously posted that made changes in
LYMain.c and LYexit.c. This is entirely within LYMain.c and seems
cleaner.  As before, this will allow exiting via SIGINT when pressing
CTL-C or CTL-BREAK regardless of the BREAK setting in DOS, and leaves
the BREAK setting unchanged unless CTL-C or CTL-BREAK is actually
pressed (in which case it leaves BREAK ON).

Regarding the printing of the traceback when 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]