/[make]/make/commands.c
ViewVC logotype

Diff of /make/commands.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.59 by psmith, Fri Mar 4 12:52:32 2005 UTC revision 1.60 by psmith, Mon Aug 8 05:08:00 2005 UTC
# Line 23  Boston, MA 02111-1307, USA.  */ Line 23  Boston, MA 02111-1307, USA.  */
23  #include "variable.h"  #include "variable.h"
24  #include "job.h"  #include "job.h"
25  #include "commands.h"  #include "commands.h"
26    #ifdef WINDOWS32
27    #include <windows.h>
28    #include "w32err.h"
29    #endif
30    
31  #if VMS  #if VMS
32  # define FILE_LIST_SEPARATOR ','  # define FILE_LIST_SEPARATOR ','
# Line 420  fatal_error_signal (int sig) Line 424  fatal_error_signal (int sig)
424    
425    exit (10);    exit (10);
426  #else /* not Amiga */  #else /* not Amiga */
427    #ifdef WINDOWS32
428      extern HANDLE main_thread;
429    
430      /* Windows creates a sperate thread for handling Ctrl+C, so we need
431         to suspend the main thread, or else we will have race conditions
432         when both threads call reap_children.  */
433      if (main_thread)
434        {
435          DWORD susp_count = SuspendThread (main_thread);
436    
437          if (susp_count != 0)
438            fprintf (stderr, "SuspendThread: suspend count = %ld\n", susp_count);
439          else if (susp_count == (DWORD)-1)
440            {
441              DWORD ierr = GetLastError ();
442    
443              fprintf (stderr, "SuspendThread: error %ld: %s\n",
444                       ierr, map_windows32_error_to_string (ierr));
445            }
446        }
447    #endif
448    handling_fatal_signal = 1;    handling_fatal_signal = 1;
449    
450    /* Set the handling for this signal to the default.    /* Set the handling for this signal to the default.
# Line 482  fatal_error_signal (int sig) Line 507  fatal_error_signal (int sig)
507  #endif  #endif
508    
509  #ifdef WINDOWS32  #ifdef WINDOWS32
510    /* Cannot call W32_kill with a pid (it needs a handle) */    if (main_thread)
511    exit (EXIT_FAILURE);      CloseHandle (main_thread);
512      /* Cannot call W32_kill with a pid (it needs a handle).  The exit
513         status of 130 emulates what happens in Bash.  */
514      exit (130);
515  #else  #else
516    /* Signal the same code; this time it will really be fatal.  The signal    /* Signal the same code; this time it will really be fatal.  The signal
517       will be unblocked when we return and arrive then to kill us.  */       will be unblocked when we return and arrive then to kill us.  */

Legend:
Removed from v.1.59  
changed lines
  Added in v.1.60

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26