VirtualBox

Changeset 501 in kBuild for vendor/gnumake/current/commands.c


Ignore:
Timestamp:
Sep 15, 2006 2:30:32 AM (19 years ago)
Author:
bird
Message:

Load make-3.81/ into vendor/gnumake/current.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/gnumake/current/commands.c

    r280 r501  
    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
     
    425428  exit (10);
    426429#else /* not Amiga */
     430#ifdef WINDOWS32
     431  extern HANDLE main_thread;
     432
     433  /* Windows creates a sperate thread for handling Ctrl+C, so we need
     434     to suspend the main thread, or else we will have race conditions
     435     when both threads call reap_children.  */
     436  if (main_thread)
     437    {
     438      DWORD susp_count = SuspendThread (main_thread);
     439
     440      if (susp_count != 0)
     441        fprintf (stderr, "SuspendThread: suspend count = %ld\n", susp_count);
     442      else if (susp_count == (DWORD)-1)
     443        {
     444          DWORD ierr = GetLastError ();
     445
     446          fprintf (stderr, "SuspendThread: error %ld: %s\n",
     447                   ierr, map_windows32_error_to_string (ierr));
     448        }
     449    }
     450#endif
    427451  handling_fatal_signal = 1;
    428452
     
    487511
    488512#ifdef WINDOWS32
    489   /* Cannot call W32_kill with a pid (it needs a handle) */
    490   exit (EXIT_FAILURE);
     513  if (main_thread)
     514    CloseHandle (main_thread);
     515  /* Cannot call W32_kill with a pid (it needs a handle).  The exit
     516     status of 130 emulates what happens in Bash.  */
     517  exit (130);
    491518#else
    492519  /* Signal the same code; this time it will really be fatal.  The signal
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette