Ignore:
Timestamp:
Sep 15, 2006, 7:09:38 AM (19 years ago)
Author:
bird
Message:

Untested merge with GNU Make v3.81 (vendor/gnumake/2005-05-16 -> vendor/gnumake/current).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gmake/commands.c

    r352 r503  
    11/* Command processing for GNU Make.
    2 Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc.
     2Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
     31998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
     4Foundation, Inc.
    35This file is part of GNU Make.
    46
    5 GNU Make is free software; you can redistribute it and/or modify
    6 it under the terms of the GNU General Public License as published by
    7 the Free Software Foundation; either version 2, or (at your option)
    8 any later version.
    9 
    10 GNU Make is distributed in the hope that it will be useful,
    11 but WITHOUT ANY WARRANTY; without even the implied warranty of
    12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    13 GNU General Public License for more details.
    14 
    15 You should have received a copy of the GNU General Public License
    16 along with GNU Make; see the file COPYING.  If not, write to
    17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    18 Boston, MA 02111-1307, USA.  */
     7GNU Make is free software; you can redistribute it and/or modify it under the
     8terms of the GNU General Public License as published by the Free Software
     9Foundation; either version 2, or (at your option) any later version.
     10
     11GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
     12WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     13A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     14
     15You should have received a copy of the GNU General Public License along with
     16GNU Make; see the file COPYING.  If not, write to the Free Software
     17Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.  */
    1918
    2019#include "make.h"
     
    2423#include "job.h"
    2524#include "commands.h"
     25#ifdef WINDOWS32
     26#include <windows.h>
     27#include "w32err.h"
     28#endif
    2629
    2730#if VMS
     
    156159
    157160    if (plus_len > plus_max)
    158       plus_value = (char *) xmalloc (plus_max = plus_len);
     161      plus_value = xrealloc (plus_value, plus_max = plus_len);
    159162    cp = plus_value;
    160163
     
    205208
    206209    if (qmark_len > qmark_max)
    207       qmark_value = (char *) xmalloc (qmark_max = qmark_len);
     210      qmark_value = xrealloc (qmark_value, qmark_max = qmark_len);
    208211    qp = qmark_value;
    209212
    210213    if (bar_len > bar_max)
    211       bar_value = (char *) xmalloc (bar_max = bar_len);
     214      bar_value = xrealloc (bar_value, bar_max = bar_len);
    212215    bp = bar_value;
    213216
     
    432435  exit (10);
    433436#else /* not Amiga */
     437#ifdef WINDOWS32
     438  extern HANDLE main_thread;
     439
     440  /* Windows creates a sperate thread for handling Ctrl+C, so we need
     441     to suspend the main thread, or else we will have race conditions
     442     when both threads call reap_children.  */
     443  if (main_thread)
     444    {
     445      DWORD susp_count = SuspendThread (main_thread);
     446
     447      if (susp_count != 0)
     448        fprintf (stderr, "SuspendThread: suspend count = %ld\n", susp_count);
     449      else if (susp_count == (DWORD)-1)
     450        {
     451          DWORD ierr = GetLastError ();
     452
     453          fprintf (stderr, "SuspendThread: error %ld: %s\n",
     454                   ierr, map_windows32_error_to_string (ierr));
     455        }
     456    }
     457#endif
    434458  handling_fatal_signal = 1;
    435459
     
    494518
    495519#ifdef WINDOWS32
    496   /* Cannot call W32_kill with a pid (it needs a handle) */
    497   exit (EXIT_FAILURE);
     520  if (main_thread)
     521    CloseHandle (main_thread);
     522  /* Cannot call W32_kill with a pid (it needs a handle).  The exit
     523     status of 130 emulates what happens in Bash.  */
     524  exit (130);
    498525#else
    499526  /* Signal the same code; this time it will really be fatal.  The signal
Note: See TracChangeset for help on using the changeset viewer.