Changeset 501 in kBuild for vendor/gnumake/current/w32
- Timestamp:
- Sep 15, 2006 2:30:32 AM (19 years ago)
- Location:
- vendor/gnumake/current/w32
- Files:
-
- 7 added
- 1 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/gnumake/current/w32/Makefile.am
r283 r501 1 1 # Makefile.am to create libw32.a for mingw32 host. 2 # Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 3 # Free Software Foundation, Inc. 4 # This file is part of GNU Make. 5 # 6 # GNU Make is free software; you can redistribute it and/or modify it under the 7 # terms of the GNU General Public License as published by the Free Software 8 # Foundation; either version 2, or (at your option) any later version. 9 # 10 # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 12 # A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 # 14 # You should have received a copy of the GNU General Public License along with 15 # GNU Make; see the file COPYING. If not, write to the Free Software 16 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2 17 3 18 noinst_LIBRARIES = libw32.a -
vendor/gnumake/current/w32/compat/dirent.c
r53 r501 1 /* Directory entry code for Window platforms. 2 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 3 2006 Free Software Foundation, Inc. 4 This file is part of GNU Make. 5 6 GNU Make is free software; you can redistribute it and/or modify it under the 7 terms of the GNU General Public License as published by the Free Software 8 Foundation; either version 2, or (at your option) any later version. 9 10 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 12 A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License along with 15 GNU Make; see the file COPYING. If not, write to the Free Software 16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ 17 18 1 19 #include <sys/types.h> 2 20 #include <sys/stat.h> … … 58 76 /* other values defaulted */ 59 77 pDir->dir_nNumFiles = 0; 60 pDir->dir_hDirHandle = INVALID_HANDLE_VALUE; 78 pDir->dir_hDirHandle = INVALID_HANDLE_VALUE; 61 79 pDir->dir_ulCookie = __DIRENT_COOKIE; 62 80 -
vendor/gnumake/current/w32/include/dirent.h
r53 r501 1 1 /* Windows version of dirent.h 2 Copyright (C) 1996, 1997, 2003 Free Software Foundation, Inc. 2 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 3 2006 Free Software Foundation, Inc. 3 4 This file is part of GNU Make. 4 5 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. 6 GNU Make is free software; you can redistribute it and/or modify it under the 7 terms of the GNU General Public License as published by the Free Software 8 Foundation; either version 2, or (at your option) any later version. 9 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. 10 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 12 A PARTICULAR PURPOSE. See the GNU General Public License for more details. 14 13 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, Boston, 18 MA 02111-1307, USA. */ 14 You should have received a copy of the GNU General Public License along with 15 GNU Make; see the file COPYING. If not, write to the Free Software 16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ 19 17 20 18 #ifndef _DIRENT_H -
vendor/gnumake/current/w32/include/pathstuff.h
r53 r501 1 /* Definitions for Windows path manipulation. 2 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 3 2006 Free Software Foundation, Inc. 4 This file is part of GNU Make. 5 6 GNU Make is free software; you can redistribute it and/or modify it under the 7 terms of the GNU General Public License as published by the Free Software 8 Foundation; either version 2, or (at your option) any later version. 9 10 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 12 A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License along with 15 GNU Make; see the file COPYING. If not, write to the Free Software 16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ 17 1 18 #ifndef _PATHSTUFF_H 2 19 #define _PATHSTUFF_H -
vendor/gnumake/current/w32/include/sub_proc.h
r284 r501 1 /* Definitions for Windows process invocation. 2 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 3 2006 Free Software Foundation, Inc. 4 This file is part of GNU Make. 5 6 GNU Make is free software; you can redistribute it and/or modify it under the 7 terms of the GNU General Public License as published by the Free Software 8 Foundation; either version 2, or (at your option) any later version. 9 10 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 12 A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License along with 15 GNU Make; see the file COPYING. If not, write to the Free Software 16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ 17 1 18 #ifndef SUB_PROC_H 2 19 #define SUB_PROC_H … … 5 22 * Component Name: 6 23 * 7 * $Date: 200 5/02/10 00:10:58$24 * $Date: 2006/02/11 22:16:05 $ 8 25 * 9 * $Source: / cvsroot/make/make/w32/include/sub_proc.h,v $26 * $Source: /sources/make/make/w32/include/sub_proc.h,v $ 10 27 * 11 * $ Revision: 1.5$28 * $Id: sub_proc.h,v 1.8 2006/02/11 22:16:05 psmith Exp $ 12 29 */ 13 14 /* $Id: sub_proc.h,v 1.5 2005/02/10 00:10:58 psmith Exp $ */15 30 16 31 #define EXTERN_DECL(entry, args) extern entry args … … 30 45 EXTERN_DECL(HANDLE process_easy, (char** argv, char** env)); 31 46 EXTERN_DECL(BOOL process_kill, (HANDLE proc, int signal)); 47 EXTERN_DECL(int process_used_slots, (VOID_DECL)); 32 48 33 49 /* support routines */ -
vendor/gnumake/current/w32/include/w32err.h
r53 r501 1 /* Definitions for Windows error handling. 2 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 3 2006 Free Software Foundation, Inc. 4 This file is part of GNU Make. 5 6 GNU Make is free software; you can redistribute it and/or modify it under the 7 terms of the GNU General Public License as published by the Free Software 8 Foundation; either version 2, or (at your option) any later version. 9 10 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 12 A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License along with 15 GNU Make; see the file COPYING. If not, write to the Free Software 16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ 17 1 18 #ifndef _W32ERR_H_ 2 19 #define _W32ERR_H_ -
vendor/gnumake/current/w32/pathstuff.c
r53 r501 1 /* Path conversion for Windows pathnames. 2 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 3 2006 Free Software Foundation, Inc. 4 This file is part of GNU Make. 5 6 GNU Make is free software; you can redistribute it and/or modify it under the 7 terms of the GNU General Public License as published by the Free Software 8 Foundation; either version 2, or (at your option) any later version. 9 10 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 12 A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License along with 15 GNU Make; see the file COPYING. If not, write to the Free Software 16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ 17 1 18 #include <string.h> 2 19 #include <stdlib.h> … … 87 104 getcwd_fs(char* buf, int len) 88 105 { 89 char *p ;90 91 if (p = getcwd(buf, len)) {106 char *p = getcwd(buf, len); 107 108 if (p) { 92 109 char *q = w32ify(buf, 0); 93 110 strncpy(buf, q, len); -
vendor/gnumake/current/w32/subproc/NMakefile
r284 r501 2 2 # `build.bat' instead. 3 3 # 4 # Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc 4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 5 # 2006 Free Software Foundation, Inc. 5 6 # This file is part of GNU Make. 6 7 # 7 # GNU Make is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2, or (at your option) 10 # any later version. 8 # GNU Make is free software; you can redistribute it and/or modify it under the 9 # terms of the GNU General Public License as published by the Free Software 10 # Foundation; either version 2, or (at your option) any later version. 11 11 # 12 # GNU Make is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 12 # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 14 # A PARTICULAR PURPOSE. See the GNU General Public License for more details. 16 15 # 17 # You should have received a copy of the GNU General Public License 18 # along with GNU Make; see the file COPYING. If not, write to19 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139,USA.16 # You should have received a copy of the GNU General Public License along with 17 # GNU Make; see the file COPYING. If not, write to the Free Software 18 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 19 21 20 # … … 29 28 MAKEFILE=NMakefile 30 29 31 CFLAGS_any = /nologo /MT /W 3/GX /Z7 /YX /D WIN32 /D WINDOWS32 /D _WINDOWS -I. -I../include -I../../30 CFLAGS_any = /nologo /MT /W4 /GX /Z7 /YX /D WIN32 /D WINDOWS32 /D _WINDOWS -I. -I../include -I../../ 32 31 CFLAGS_debug = $(CFLAGS_any) /Od /D _DEBUG /FR.\WinDebug\ /Fp.\WinDebug\subproc.pch /Fo.\WinDebug/ 33 32 CFLAGS_release = $(CFLAGS_any) /O2 /FR.\WinRel\ /Fp.\WinRel\subproc.pch /Fo.\WinRel/ -
vendor/gnumake/current/w32/subproc/build.bat
r53 r501 1 @if "%1" == "gcc" GoTo GCCBuild 1 2 if not exist .\WinDebug\nul mkdir .\WinDebug 2 cl.exe /nologo /MT /W 3/GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c misc.c3 cl.exe /nologo /MT /W 3/GX /Z7 /YX /Od /I .. /I . /I ../include /I ../.. /D WIN32 /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c sub_proc.c4 cl.exe /nologo /MT /W 3/GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c w32err.c3 cl.exe /nologo /MT /W4 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c misc.c 4 cl.exe /nologo /MT /W4 /GX /Z7 /YX /Od /I .. /I . /I ../include /I ../.. /D WIN32 /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c sub_proc.c 5 cl.exe /nologo /MT /W4 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c w32err.c 5 6 lib.exe /NOLOGO /OUT:.\WinDebug\subproc.lib .\WinDebug/misc.obj .\WinDebug/sub_proc.obj .\WinDebug/w32err.obj 6 7 if not exist .\WinRel\nul mkdir .\WinRel 7 cl.exe /nologo /MT /W 3/GX /YX /O2 /I ../include /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c misc.c8 cl.exe /nologo /MT /W 3/GX /YX /O2 /I ../include /I ../.. /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c sub_proc.c9 cl.exe /nologo /MT /W 3/GX /YX /O2 /I ../include /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c w32err.c8 cl.exe /nologo /MT /W4 /GX /YX /O2 /I ../include /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c misc.c 9 cl.exe /nologo /MT /W4 /GX /YX /O2 /I ../include /I ../.. /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c sub_proc.c 10 cl.exe /nologo /MT /W4 /GX /YX /O2 /I ../include /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c w32err.c 10 11 lib.exe /NOLOGO /OUT:.\WinRel\subproc.lib .\WinRel/misc.obj .\WinRel/sub_proc.obj .\WinRel/w32err.obj 12 GoTo BuildEnd 13 :GCCBuild 14 gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I.. -I. -I../include -I../.. -DWINDOWS32 -c misc.c -o ../../w32_misc.o 15 gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I.. -I. -I../include -I../.. -DWINDOWS32 -c sub_proc.c -o ../../sub_proc.o 16 gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I.. -I. -I../include -I../.. -DWINDOWS32 -c w32err.c -o ../../w32err.o 17 :BuildEnd 18 19 @echo off 20 rem Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 21 rem 2005, 2006 Free Software Foundation, Inc. 22 rem This file is part of GNU Make. 23 24 rem GNU Make is free software; you can redistribute it and/or modify it under the 25 rem terms of the GNU General Public License as published by the Free Software 26 rem Foundation; either version 2, or (at your option) any later version. 27 28 rem GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 29 rem WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 30 rem A PARTICULAR PURPOSE. See the GNU General Public License for more details. 31 32 rem You should have received a copy of the GNU General Public License along with 33 rem GNU Make; see the file COPYING. If not, write to the Free Software 34 rem Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -
vendor/gnumake/current/w32/subproc/misc.c
r53 r501 1 /* Process handling for Windows 2 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 3 2006 Free Software Foundation, Inc. 4 This file is part of GNU Make. 5 6 GNU Make is free software; you can redistribute it and/or modify it under the 7 terms of the GNU General Public License as published by the Free Software 8 Foundation; either version 2, or (at your option) any later version. 9 10 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 12 A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License along with 15 GNU Make; see the file COPYING. If not, write to the Free Software 16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ 17 1 18 #include <stddef.h> 2 19 #include <stdlib.h> … … 20 37 } 21 38 bool_t 22 arr2envblk(char **arr, char **envblk_out) 39 arr2envblk(char **arr, char **envblk_out) 23 40 { 24 41 char **tmp; -
vendor/gnumake/current/w32/subproc/proc.h
r53 r501 1 /* Definitions for Windows 2 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 3 2006 Free Software Foundation, Inc. 4 This file is part of GNU Make. 5 6 GNU Make is free software; you can redistribute it and/or modify it under the 7 terms of the GNU General Public License as published by the Free Software 8 Foundation; either version 2, or (at your option) any later version. 9 10 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 12 A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License along with 15 GNU Make; see the file COPYING. If not, write to the Free Software 16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ 17 1 18 #ifndef _PROC_H 2 19 #define _PROC_H -
vendor/gnumake/current/w32/subproc/sub_proc.c
r284 r501 1 /* Process handling for Windows. 2 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 3 2006 Free Software Foundation, Inc. 4 This file is part of GNU Make. 5 6 GNU Make is free software; you can redistribute it and/or modify it under the 7 terms of the GNU General Public License as published by the Free Software 8 Foundation; either version 2, or (at your option) any later version. 9 10 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 12 A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License along with 15 GNU Make; see the file COPYING. If not, write to the Free Software 16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ 17 1 18 #include <stdlib.h> 2 19 #include <stdio.h> 3 20 #include <process.h> /* for msvc _beginthreadex, _endthreadex */ 21 #include <signal.h> 4 22 #include <windows.h> 5 23 … … 31 49 32 50 /* keep track of children so we can implement a waitpid-like routine */ 33 static sub_process *proc_array[ 256];51 static sub_process *proc_array[MAXIMUM_WAIT_OBJECTS]; 34 52 static int proc_index = 0; 35 53 static int fake_exits_pending = 0; … … 66 84 process_wait_for_any_private(void) 67 85 { 68 HANDLE handles[ 256];86 HANDLE handles[MAXIMUM_WAIT_OBJECTS]; 69 87 DWORD retval, which; 70 88 int i; … … 120 138 process_register(HANDLE proc) 121 139 { 122 proc_array[proc_index++] = (sub_process *) proc; 140 if (proc_index < MAXIMUM_WAIT_OBJECTS) 141 proc_array[proc_index++] = (sub_process *) proc; 142 } 143 144 /* 145 * Return the number of processes that we are still waiting for. 146 */ 147 int 148 process_used_slots(void) 149 { 150 return proc_index; 123 151 } 124 152 … … 163 191 164 192 long 165 process_errno(HANDLE proc) 166 { 167 return (((sub_process *)proc)->lerrno); 193 process_signal(HANDLE proc) 194 { 195 if (proc == INVALID_HANDLE_VALUE) return 0; 196 return (((sub_process *)proc)->signal); 168 197 } 169 198 170 199 long 171 process_signal(HANDLE proc)172 {173 return (((sub_process *)proc)->signal);174 }175 176 long177 200 process_last_err(HANDLE proc) 178 201 { 202 if (proc == INVALID_HANDLE_VALUE) return ERROR_INVALID_HANDLE; 179 203 return (((sub_process *)proc)->last_err); 180 204 } 181 205 182 206 long 183 207 process_exit_code(HANDLE proc) 184 208 { 209 if (proc == INVALID_HANDLE_VALUE) return EXIT_FAILURE; 185 210 return (((sub_process *)proc)->exit_code); 186 211 } 187 212 188 char * 213 /* 214 2006-02: 215 All the following functions are currently unused. 216 All of them would crash gmake if called with argument INVALID_HANDLE_VALUE. 217 Hence whoever wants to use one of this functions must invent and implement 218 a reasonable error handling for this function. 219 220 char * 189 221 process_outbuf(HANDLE proc) 190 222 { … … 192 224 } 193 225 194 226 char * 195 227 process_errbuf(HANDLE proc) 196 228 { … … 198 230 } 199 231 200 232 int 201 233 process_outcnt(HANDLE proc) 202 234 { … … 204 236 } 205 237 206 238 int 207 239 process_errcnt(HANDLE proc) 208 240 { … … 210 242 } 211 243 212 244 void 213 245 process_pipes(HANDLE proc, int pipes[3]) 214 246 { … … 218 250 return; 219 251 } 220 252 */ 221 253 222 254 HANDLE … … 369 401 * Description: Create the child process to be helped 370 402 * 371 * Returns: 403 * Returns: success <=> 0 372 404 * 373 405 * Notes/Dependencies: … … 523 555 pproc->last_err = GetLastError(); 524 556 pproc->lerrno = E_FORK; 525 fprintf(stderr, "process_begin: CreateProcess(%s, %s, ...) failed.\n", exec_path, command_line); 557 fprintf(stderr, "process_begin: CreateProcess(%s, %s, ...) failed.\n", 558 exec_path ? exec_path : "NULL", command_line); 526 559 if (envblk) free(envblk); 527 560 free( command_line ); … … 535 568 536 569 /* Close the halves of the pipes we don't need */ 537 if (pproc->sv_stdin) { 538 CloseHandle((HANDLE)pproc->sv_stdin[1]); 539 (HANDLE)pproc->sv_stdin[1] = 0; 540 } 541 if (pproc->sv_stdout) { 542 CloseHandle((HANDLE)pproc->sv_stdout[1]); 543 (HANDLE)pproc->sv_stdout[1] = 0; 544 } 545 if (pproc->sv_stderr) { 546 CloseHandle((HANDLE)pproc->sv_stderr[1]); 547 (HANDLE)pproc->sv_stderr[1] = 0; 548 } 570 CloseHandle((HANDLE)pproc->sv_stdin[1]); 571 CloseHandle((HANDLE)pproc->sv_stdout[1]); 572 CloseHandle((HANDLE)pproc->sv_stderr[1]); 573 pproc->sv_stdin[1] = 0; 574 pproc->sv_stdout[1] = 0; 575 pproc->sv_stderr[1] = 0; 549 576 550 577 free( command_line ); … … 658 685 bool_t stdin_eof = FALSE, stdout_eof = FALSE, stderr_eof = FALSE; 659 686 HANDLE childhand = (HANDLE) pproc->pid; 660 HANDLE tStdin , tStdout, tStderr;661 DWORDdwStdin, dwStdout, dwStderr;687 HANDLE tStdin = NULL, tStdout = NULL, tStderr = NULL; 688 unsigned int dwStdin, dwStdout, dwStderr; 662 689 HANDLE wait_list[4]; 663 690 DWORD wait_count; … … 675 702 stdin_eof = TRUE; 676 703 CloseHandle((HANDLE)pproc->sv_stdin[0]); 677 (HANDLE)pproc->sv_stdin[0] = 0;704 pproc->sv_stdin[0] = 0; 678 705 } else { 679 706 tStdin = (HANDLE) _beginthreadex( 0, 1024, 680 (unsigned (__stdcall *) (void *))proc_stdin_thread, pproc, 0,681 (unsigned int *)&dwStdin);707 (unsigned (__stdcall *) (void *))proc_stdin_thread, 708 pproc, 0, &dwStdin); 682 709 if (tStdin == 0) { 683 710 pproc->last_err = GetLastError(); … … 692 719 tStdout = (HANDLE) _beginthreadex( 0, 1024, 693 720 (unsigned (__stdcall *) (void *))proc_stdout_thread, pproc, 0, 694 (unsigned int *)&dwStdout);721 &dwStdout); 695 722 tStderr = (HANDLE) _beginthreadex( 0, 1024, 696 723 (unsigned (__stdcall *) (void *))proc_stderr_thread, pproc, 0, 697 (unsigned int *)&dwStderr);724 &dwStderr); 698 725 699 726 if (tStdout == 0 || tStderr == 0) { … … 740 767 if (ready_hand == tStdin) { 741 768 CloseHandle((HANDLE)pproc->sv_stdin[0]); 742 (HANDLE)pproc->sv_stdin[0] = 0;769 pproc->sv_stdin[0] = 0; 743 770 CloseHandle(tStdin); 744 771 tStdin = 0; … … 748 775 749 776 CloseHandle((HANDLE)pproc->sv_stdout[0]); 750 (HANDLE)pproc->sv_stdout[0] = 0;777 pproc->sv_stdout[0] = 0; 751 778 CloseHandle(tStdout); 752 779 tStdout = 0; … … 756 783 757 784 CloseHandle((HANDLE)pproc->sv_stderr[0]); 758 (HANDLE)pproc->sv_stderr[0] = 0;785 pproc->sv_stderr[0] = 0; 759 786 CloseHandle(tStderr); 760 787 tStderr = 0; … … 763 790 } else if (ready_hand == childhand) { 764 791 765 GetExitCodeResult = GetExitCodeProcess(childhand, (DWORD*)&pproc->exit_code); 792 DWORD ierr; 793 GetExitCodeResult = GetExitCodeProcess(childhand, &ierr); 794 if (ierr == CONTROL_C_EXIT) { 795 pproc->signal = SIGINT; 796 } else { 797 pproc->exit_code = ierr; 798 } 766 799 if (GetExitCodeResult == FALSE) { 767 800 pproc->last_err = GetLastError(); … … 812 845 DWORD wait_return; 813 846 BOOL GetExitCodeResult; 847 DWORD ierr; 814 848 815 849 if (proc == NULL) … … 855 889 } 856 890 857 GetExitCodeResult = GetExitCodeProcess(childhand, (DWORD*)&pproc->exit_code); 891 GetExitCodeResult = GetExitCodeProcess(childhand, &ierr); 892 if (ierr == CONTROL_C_EXIT) { 893 pproc->signal = SIGINT; 894 } else { 895 pproc->exit_code = ierr; 896 } 858 897 if (GetExitCodeResult == FALSE) { 859 898 pproc->last_err = GetLastError(); … … 1156 1195 HANDLE hProcess; 1157 1196 1197 if (proc_index >= MAXIMUM_WAIT_OBJECTS) { 1198 DB (DB_JOBS, ("process_easy: All process slots used up\n")); 1199 return INVALID_HANDLE_VALUE; 1200 } 1158 1201 if (DuplicateHandle(GetCurrentProcess(), 1159 1202 GetStdHandle(STD_INPUT_HANDLE), … … 1164 1207 DUPLICATE_SAME_ACCESS) == FALSE) { 1165 1208 fprintf(stderr, 1166 "process_easy: DuplicateHandle(In) failed (e=% d)\n",1209 "process_easy: DuplicateHandle(In) failed (e=%ld)\n", 1167 1210 GetLastError()); 1168 1211 return INVALID_HANDLE_VALUE; … … 1176 1219 DUPLICATE_SAME_ACCESS) == FALSE) { 1177 1220 fprintf(stderr, 1178 "process_easy: DuplicateHandle(Out) failed (e=% d)\n",1221 "process_easy: DuplicateHandle(Out) failed (e=%ld)\n", 1179 1222 GetLastError()); 1180 1223 return INVALID_HANDLE_VALUE; … … 1188 1231 DUPLICATE_SAME_ACCESS) == FALSE) { 1189 1232 fprintf(stderr, 1190 "process_easy: DuplicateHandle(Err) failed (e=% d)\n",1233 "process_easy: DuplicateHandle(Err) failed (e=%ld)\n", 1191 1234 GetLastError()); 1192 1235 return INVALID_HANDLE_VALUE; -
vendor/gnumake/current/w32/subproc/w32err.c
r284 r501 1 /* Error handling for Windows 2 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 3 2006 Free Software Foundation, Inc. 4 This file is part of GNU Make. 5 6 GNU Make is free software; you can redistribute it and/or modify it under the 7 terms of the GNU General Public License as published by the Free Software 8 Foundation; either version 2, or (at your option) any later version. 9 10 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 12 A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License along with 15 GNU Make; see the file COPYING. If not, write to the Free Software 16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ 17 1 18 #include <windows.h> 2 19 #include "w32err.h"
Note:
See TracChangeset
for help on using the changeset viewer.