Changeset 501 in kBuild for vendor/gnumake/current/commands.c
- Timestamp:
- Sep 15, 2006 2:30:32 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/gnumake/current/commands.c
r280 r501 1 1 /* Command processing for GNU Make. 2 Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc. 2 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 3 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software 4 Foundation, Inc. 3 5 This file is part of GNU Make. 4 6 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. */ 7 GNU Make is free software; you can redistribute it and/or modify it under the 8 terms of the GNU General Public License as published by the Free Software 9 Foundation; either version 2, or (at your option) any later version. 10 11 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 12 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 13 A PARTICULAR PURPOSE. See the GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License along with 16 GNU Make; see the file COPYING. If not, write to the Free Software 17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ 19 18 20 19 #include "make.h" … … 24 23 #include "job.h" 25 24 #include "commands.h" 25 #ifdef WINDOWS32 26 #include <windows.h> 27 #include "w32err.h" 28 #endif 26 29 27 30 #if VMS … … 156 159 157 160 if (plus_len > plus_max) 158 plus_value = (char *) xmalloc (plus_max = plus_len);161 plus_value = xrealloc (plus_value, plus_max = plus_len); 159 162 cp = plus_value; 160 163 … … 205 208 206 209 if (qmark_len > qmark_max) 207 qmark_value = (char *) xmalloc (qmark_max = qmark_len);210 qmark_value = xrealloc (qmark_value, qmark_max = qmark_len); 208 211 qp = qmark_value; 209 212 210 213 if (bar_len > bar_max) 211 bar_value = (char *) xmalloc (bar_max = bar_len);214 bar_value = xrealloc (bar_value, bar_max = bar_len); 212 215 bp = bar_value; 213 216 … … 425 428 exit (10); 426 429 #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 427 451 handling_fatal_signal = 1; 428 452 … … 487 511 488 512 #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); 491 518 #else 492 519 /* Signal the same code; this time it will really be fatal. The signal
Note:
See TracChangeset
for help on using the changeset viewer.