VirtualBox

Changeset 501 in kBuild for vendor/gnumake/current/w32


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

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

Location:
vendor/gnumake/current/w32
Files:
7 added
1 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • vendor/gnumake/current/w32/Makefile.am

    r283 r501  
    11# 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.
    217
    318noinst_LIBRARIES = libw32.a
  • vendor/gnumake/current/w32/compat/dirent.c

    r53 r501  
     1/* Directory entry code for Window platforms.
     2Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
     32006 Free Software Foundation, Inc.
     4This file is part of GNU Make.
     5
     6GNU Make is free software; you can redistribute it and/or modify it under the
     7terms of the GNU General Public License as published by the Free Software
     8Foundation; either version 2, or (at your option) any later version.
     9
     10GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
     11WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     12A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     13
     14You should have received a copy of the GNU General Public License along with
     15GNU Make; see the file COPYING.  If not, write to the Free Software
     16Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.  */
     17
     18
    119#include <sys/types.h>
    220#include <sys/stat.h>
     
    5876        /* other values defaulted */
    5977        pDir->dir_nNumFiles = 0;
    60         pDir->dir_hDirHandle = INVALID_HANDLE_VALUE;   
     78        pDir->dir_hDirHandle = INVALID_HANDLE_VALUE;
    6179        pDir->dir_ulCookie = __DIRENT_COOKIE;
    6280
  • vendor/gnumake/current/w32/include/dirent.h

    r53 r501  
    11/* Windows version of dirent.h
    2 Copyright (C) 1996, 1997, 2003 Free Software Foundation, Inc.
     2Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
     32006 Free Software Foundation, Inc.
    34This file is part of GNU Make.
    45
    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.
     6GNU Make is free software; you can redistribute it and/or modify it under the
     7terms of the GNU General Public License as published by the Free Software
     8Foundation; either version 2, or (at your option) any later version.
    99
    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.
     10GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
     11WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     12A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
    1413
    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.  */
     14You should have received a copy of the GNU General Public License along with
     15GNU Make; see the file COPYING.  If not, write to the Free Software
     16Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.  */
    1917
    2018#ifndef _DIRENT_H
  • vendor/gnumake/current/w32/include/pathstuff.h

    r53 r501  
     1/* Definitions for Windows path manipulation.
     2Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
     32006 Free Software Foundation, Inc.
     4This file is part of GNU Make.
     5
     6GNU Make is free software; you can redistribute it and/or modify it under the
     7terms of the GNU General Public License as published by the Free Software
     8Foundation; either version 2, or (at your option) any later version.
     9
     10GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
     11WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     12A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     13
     14You should have received a copy of the GNU General Public License along with
     15GNU Make; see the file COPYING.  If not, write to the Free Software
     16Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.  */
     17
    118#ifndef _PATHSTUFF_H
    219#define _PATHSTUFF_H
  • vendor/gnumake/current/w32/include/sub_proc.h

    r284 r501  
     1/* Definitions for Windows process invocation.
     2Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
     32006 Free Software Foundation, Inc.
     4This file is part of GNU Make.
     5
     6GNU Make is free software; you can redistribute it and/or modify it under the
     7terms of the GNU General Public License as published by the Free Software
     8Foundation; either version 2, or (at your option) any later version.
     9
     10GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
     11WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     12A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     13
     14You should have received a copy of the GNU General Public License along with
     15GNU Make; see the file COPYING.  If not, write to the Free Software
     16Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.  */
     17
    118#ifndef SUB_PROC_H
    219#define SUB_PROC_H
     
    522 * Component Name:
    623 *
    7  * $Date: 2005/02/10 00:10:58 $
     24 * $Date: 2006/02/11 22:16:05 $
    825 *
    9  * $Source: /cvsroot/make/make/w32/include/sub_proc.h,v $
     26 * $Source: /sources/make/make/w32/include/sub_proc.h,v $
    1027 *
    11  * $Revision: 1.5 $
     28 * $Id: sub_proc.h,v 1.8 2006/02/11 22:16:05 psmith Exp $
    1229 */
    13 
    14 /* $Id: sub_proc.h,v 1.5 2005/02/10 00:10:58 psmith Exp $ */
    1530
    1631#define EXTERN_DECL(entry, args) extern entry args
     
    3045EXTERN_DECL(HANDLE process_easy, (char** argv, char** env));
    3146EXTERN_DECL(BOOL process_kill, (HANDLE proc, int signal));
     47EXTERN_DECL(int process_used_slots, (VOID_DECL));
    3248
    3349/* support routines */
  • vendor/gnumake/current/w32/include/w32err.h

    r53 r501  
     1/* Definitions for Windows error handling.
     2Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
     32006 Free Software Foundation, Inc.
     4This file is part of GNU Make.
     5
     6GNU Make is free software; you can redistribute it and/or modify it under the
     7terms of the GNU General Public License as published by the Free Software
     8Foundation; either version 2, or (at your option) any later version.
     9
     10GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
     11WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     12A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     13
     14You should have received a copy of the GNU General Public License along with
     15GNU Make; see the file COPYING.  If not, write to the Free Software
     16Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.  */
     17
    118#ifndef _W32ERR_H_
    219#define _W32ERR_H_
  • vendor/gnumake/current/w32/pathstuff.c

    r53 r501  
     1/* Path conversion for Windows pathnames.
     2Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
     32006 Free Software Foundation, Inc.
     4This file is part of GNU Make.
     5
     6GNU Make is free software; you can redistribute it and/or modify it under the
     7terms of the GNU General Public License as published by the Free Software
     8Foundation; either version 2, or (at your option) any later version.
     9
     10GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
     11WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     12A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     13
     14You should have received a copy of the GNU General Public License along with
     15GNU Make; see the file COPYING.  If not, write to the Free Software
     16Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.  */
     17
    118#include <string.h>
    219#include <stdlib.h>
     
    87104getcwd_fs(char* buf, int len)
    88105{
    89         char *p;
    90 
    91         if (p = getcwd(buf, len)) {
     106        char *p = getcwd(buf, len);
     107
     108        if (p) {
    92109                char *q = w32ify(buf, 0);
    93110                strncpy(buf, q, len);
  • vendor/gnumake/current/w32/subproc/NMakefile

    r284 r501  
    22# `build.bat' instead.
    33#
    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.
    56# This file is part of GNU Make.
    67#
    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.
    1111#
    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.
    1615#
    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 to
    19 # 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.
    2019
    2120#
     
    2928MAKEFILE=NMakefile
    3029
    31 CFLAGS_any = /nologo /MT /W3 /GX /Z7 /YX /D WIN32 /D WINDOWS32 /D _WINDOWS  -I. -I../include -I../../
     30CFLAGS_any = /nologo /MT /W4 /GX /Z7 /YX /D WIN32 /D WINDOWS32 /D _WINDOWS  -I. -I../include -I../../
    3231CFLAGS_debug = $(CFLAGS_any) /Od /D _DEBUG /FR.\WinDebug\ /Fp.\WinDebug\subproc.pch /Fo.\WinDebug/
    3332CFLAGS_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
    12if not exist .\WinDebug\nul mkdir .\WinDebug
    2 cl.exe /nologo /MT /W3 /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
    3 cl.exe /nologo /MT /W3 /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
    4 cl.exe /nologo /MT /W3 /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
     3cl.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
     4cl.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
     5cl.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
    56lib.exe /NOLOGO /OUT:.\WinDebug\subproc.lib  .\WinDebug/misc.obj  .\WinDebug/sub_proc.obj  .\WinDebug/w32err.obj
    67if not exist .\WinRel\nul mkdir .\WinRel
    7 cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c misc.c
    8 cl.exe /nologo /MT /W3 /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
    9 cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c w32err.c
     8cl.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
     9cl.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
     10cl.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
    1011lib.exe /NOLOGO /OUT:.\WinRel\subproc.lib  .\WinRel/misc.obj  .\WinRel/sub_proc.obj  .\WinRel/w32err.obj
     12GoTo BuildEnd
     13:GCCBuild
     14gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I.. -I. -I../include -I../.. -DWINDOWS32 -c misc.c -o ../../w32_misc.o
     15gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I.. -I. -I../include -I../.. -DWINDOWS32 -c sub_proc.c -o ../../sub_proc.o
     16gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I.. -I. -I../include -I../.. -DWINDOWS32 -c w32err.c -o ../../w32err.o
     17:BuildEnd
     18
     19@echo off
     20rem Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
     21rem 2005, 2006 Free Software Foundation, Inc.
     22rem This file is part of GNU Make.
     23
     24rem GNU Make is free software; you can redistribute it and/or modify it under the
     25rem terms of the GNU General Public License as published by the Free Software
     26rem Foundation; either version 2, or (at your option) any later version.
     27
     28rem GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
     29rem WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     30rem A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     31
     32rem You should have received a copy of the GNU General Public License along with
     33rem GNU Make; see the file COPYING.  If not, write to the Free Software
     34rem 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
     2Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
     32006 Free Software Foundation, Inc.
     4This file is part of GNU Make.
     5
     6GNU Make is free software; you can redistribute it and/or modify it under the
     7terms of the GNU General Public License as published by the Free Software
     8Foundation; either version 2, or (at your option) any later version.
     9
     10GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
     11WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     12A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     13
     14You should have received a copy of the GNU General Public License along with
     15GNU Make; see the file COPYING.  If not, write to the Free Software
     16Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.  */
     17
    118#include <stddef.h>
    219#include <stdlib.h>
     
    2037}
    2138bool_t
    22 arr2envblk(char **arr, char **envblk_out) 
     39arr2envblk(char **arr, char **envblk_out)
    2340{
    2441        char **tmp;
  • vendor/gnumake/current/w32/subproc/proc.h

    r53 r501  
     1/* Definitions for Windows
     2Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
     32006 Free Software Foundation, Inc.
     4This file is part of GNU Make.
     5
     6GNU Make is free software; you can redistribute it and/or modify it under the
     7terms of the GNU General Public License as published by the Free Software
     8Foundation; either version 2, or (at your option) any later version.
     9
     10GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
     11WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     12A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     13
     14You should have received a copy of the GNU General Public License along with
     15GNU Make; see the file COPYING.  If not, write to the Free Software
     16Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.  */
     17
    118#ifndef  _PROC_H
    219#define _PROC_H
  • vendor/gnumake/current/w32/subproc/sub_proc.c

    r284 r501  
     1/* Process handling for Windows.
     2Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
     32006 Free Software Foundation, Inc.
     4This file is part of GNU Make.
     5
     6GNU Make is free software; you can redistribute it and/or modify it under the
     7terms of the GNU General Public License as published by the Free Software
     8Foundation; either version 2, or (at your option) any later version.
     9
     10GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
     11WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     12A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     13
     14You should have received a copy of the GNU General Public License along with
     15GNU Make; see the file COPYING.  If not, write to the Free Software
     16Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.  */
     17
    118#include <stdlib.h>
    219#include <stdio.h>
    320#include <process.h>  /* for msvc _beginthreadex, _endthreadex */
     21#include <signal.h>
    422#include <windows.h>
    523
     
    3149
    3250/* keep track of children so we can implement a waitpid-like routine */
    33 static sub_process *proc_array[256];
     51static sub_process *proc_array[MAXIMUM_WAIT_OBJECTS];
    3452static int proc_index = 0;
    3553static int fake_exits_pending = 0;
     
    6684process_wait_for_any_private(void)
    6785{
    68         HANDLE handles[256];
     86        HANDLE handles[MAXIMUM_WAIT_OBJECTS];
    6987        DWORD retval, which;
    7088        int i;
     
    120138process_register(HANDLE proc)
    121139{
    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 */
     147int
     148process_used_slots(void)
     149{
     150        return proc_index;
    123151}
    124152
     
    163191
    164192long
    165 process_errno(HANDLE proc)
    166 {
    167         return (((sub_process *)proc)->lerrno);
     193process_signal(HANDLE proc)
     194{
     195        if (proc == INVALID_HANDLE_VALUE) return 0;
     196        return (((sub_process *)proc)->signal);
    168197}
    169198
    170199long
    171 process_signal(HANDLE proc)
    172 {
    173         return (((sub_process *)proc)->signal);
    174 }
    175 
    176         long
    177200process_last_err(HANDLE proc)
    178201{
     202        if (proc == INVALID_HANDLE_VALUE) return ERROR_INVALID_HANDLE;
    179203        return (((sub_process *)proc)->last_err);
    180204}
    181205
    182         long
     206long
    183207process_exit_code(HANDLE proc)
    184208{
     209        if (proc == INVALID_HANDLE_VALUE) return EXIT_FAILURE;
    185210        return (((sub_process *)proc)->exit_code);
    186211}
    187212
    188         char *
     213/*
     2142006-02:
     215All the following functions are currently unused.
     216All of them would crash gmake if called with argument INVALID_HANDLE_VALUE.
     217Hence whoever wants to use one of this functions must invent and implement
     218a reasonable error handling for this function.
     219
     220char *
    189221process_outbuf(HANDLE proc)
    190222{
     
    192224}
    193225
    194         char *
     226char *
    195227process_errbuf(HANDLE proc)
    196228{
     
    198230}
    199231
    200         int
     232int
    201233process_outcnt(HANDLE proc)
    202234{
     
    204236}
    205237
    206         int
     238int
    207239process_errcnt(HANDLE proc)
    208240{
     
    210242}
    211243
    212         void
     244void
    213245process_pipes(HANDLE proc, int pipes[3])
    214246{
     
    218250        return;
    219251}
    220 
     252*/
    221253
    222254        HANDLE
     
    369401 * Description:   Create the child process to be helped
    370402 *
    371  * Returns:
     403 * Returns: success <=> 0
    372404 *
    373405 * Notes/Dependencies:
     
    523555                        pproc->last_err = GetLastError();
    524556                        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);
    526559                        if (envblk) free(envblk);
    527560                        free( command_line );
     
    535568
    536569        /* 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;
    549576
    550577        free( command_line );
     
    658685        bool_t stdin_eof = FALSE, stdout_eof = FALSE, stderr_eof = FALSE;
    659686        HANDLE childhand = (HANDLE) pproc->pid;
    660         HANDLE tStdin, tStdout, tStderr;
    661         DWORD dwStdin, dwStdout, dwStderr;
     687        HANDLE tStdin = NULL, tStdout = NULL, tStderr = NULL;
     688        unsigned int dwStdin, dwStdout, dwStderr;
    662689        HANDLE wait_list[4];
    663690        DWORD wait_count;
     
    675702                stdin_eof = TRUE;
    676703                CloseHandle((HANDLE)pproc->sv_stdin[0]);
    677                 (HANDLE)pproc->sv_stdin[0] = 0;
     704                pproc->sv_stdin[0] = 0;
    678705        } else {
    679706                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);
    682709                if (tStdin == 0) {
    683710                        pproc->last_err = GetLastError();
     
    692719        tStdout = (HANDLE) _beginthreadex( 0, 1024,
    693720                (unsigned (__stdcall *) (void *))proc_stdout_thread, pproc, 0,
    694                 (unsigned int *) &dwStdout);
     721                &dwStdout);
    695722        tStderr = (HANDLE) _beginthreadex( 0, 1024,
    696723                (unsigned (__stdcall *) (void *))proc_stderr_thread, pproc, 0,
    697                 (unsigned int *) &dwStderr);
     724                &dwStderr);
    698725
    699726        if (tStdout == 0 || tStderr == 0) {
     
    740767                if (ready_hand == tStdin) {
    741768                        CloseHandle((HANDLE)pproc->sv_stdin[0]);
    742                         (HANDLE)pproc->sv_stdin[0] = 0;
     769                        pproc->sv_stdin[0] = 0;
    743770                        CloseHandle(tStdin);
    744771                        tStdin = 0;
     
    748775
    749776                        CloseHandle((HANDLE)pproc->sv_stdout[0]);
    750                         (HANDLE)pproc->sv_stdout[0] = 0;
     777                        pproc->sv_stdout[0] = 0;
    751778                        CloseHandle(tStdout);
    752779                        tStdout = 0;
     
    756783
    757784                        CloseHandle((HANDLE)pproc->sv_stderr[0]);
    758                         (HANDLE)pproc->sv_stderr[0] = 0;
     785                        pproc->sv_stderr[0] = 0;
    759786                        CloseHandle(tStderr);
    760787                        tStderr = 0;
     
    763790                } else if (ready_hand == childhand) {
    764791
    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                        }
    766799                        if (GetExitCodeResult == FALSE) {
    767800                                pproc->last_err = GetLastError();
     
    812845        DWORD wait_return;
    813846        BOOL GetExitCodeResult;
     847        DWORD ierr;
    814848
    815849        if (proc == NULL)
     
    855889        }
    856890
    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        }
    858897        if (GetExitCodeResult == FALSE) {
    859898                pproc->last_err = GetLastError();
     
    11561195  HANDLE hProcess;
    11571196
     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  }
    11581201  if (DuplicateHandle(GetCurrentProcess(),
    11591202                      GetStdHandle(STD_INPUT_HANDLE),
     
    11641207                      DUPLICATE_SAME_ACCESS) == FALSE) {
    11651208    fprintf(stderr,
    1166             "process_easy: DuplicateHandle(In) failed (e=%d)\n",
     1209            "process_easy: DuplicateHandle(In) failed (e=%ld)\n",
    11671210            GetLastError());
    11681211    return INVALID_HANDLE_VALUE;
     
    11761219                      DUPLICATE_SAME_ACCESS) == FALSE) {
    11771220    fprintf(stderr,
    1178            "process_easy: DuplicateHandle(Out) failed (e=%d)\n",
     1221           "process_easy: DuplicateHandle(Out) failed (e=%ld)\n",
    11791222           GetLastError());
    11801223    return INVALID_HANDLE_VALUE;
     
    11881231                      DUPLICATE_SAME_ACCESS) == FALSE) {
    11891232    fprintf(stderr,
    1190             "process_easy: DuplicateHandle(Err) failed (e=%d)\n",
     1233            "process_easy: DuplicateHandle(Err) failed (e=%ld)\n",
    11911234            GetLastError());
    11921235    return INVALID_HANDLE_VALUE;
  • vendor/gnumake/current/w32/subproc/w32err.c

    r284 r501  
     1/* Error handling for Windows
     2Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
     32006 Free Software Foundation, Inc.
     4This file is part of GNU Make.
     5
     6GNU Make is free software; you can redistribute it and/or modify it under the
     7terms of the GNU General Public License as published by the Free Software
     8Foundation; either version 2, or (at your option) any later version.
     9
     10GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
     11WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     12A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     13
     14You should have received a copy of the GNU General Public License along with
     15GNU Make; see the file COPYING.  If not, write to the Free Software
     16Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.  */
     17
    118#include <windows.h>
    219#include "w32err.h"
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