re PR bootstrap/17832 (Bootstrap broken by fixincludes failures)

PR bootstrap/17832

	* fixincl.c (SIGCHLD): Remove definition.
	(initialize): Remove SIGIOT and SIGPIPE checks.
	(create_file): Fix mkdir() for Win32.
	(internal_fix): Use dup2() instead of fcntl().

	* fixlib.h (SIGQUIT): Define if undefined.
	(SIGIOT): Same.
	(SIGPIPE): Same.
	(SIGALRM): Same.
	(SIGKILL): Same.

	* procopen.c (chain_open): Use dup2() instead of fcntl().

From-SVN: r89326
This commit is contained in:
Aaron W. LaFramboise 2004-10-20 02:21:09 -06:00 committed by Aaron W. LaFramboise
parent d65c67104f
commit f4a8f2791c
4 changed files with 47 additions and 13 deletions

View File

@ -1,3 +1,20 @@
2004-10-20 Aaron W. LaFramboise <aaronavay62@aaronwl.com>
PR bootstrap/17832
* fixincl.c (SIGCHLD): Remove definition.
(initialize): Remove SIGIOT and SIGPIPE checks.
(create_file): Fix mkdir() for Win32.
(internal_fix): Use dup2() instead of fcntl().
* fixlib.h (SIGQUIT): Define if undefined.
(SIGIOT): Same.
(SIGPIPE): Same.
(SIGALRM): Same.
(SIGKILL): Same.
* procopen.c (chain_open): Use dup2() instead of fcntl().
2004-08-14 Paolo Bonzini <bonzini@gnu.org> 2004-08-14 Paolo Bonzini <bonzini@gnu.org>
PR other/17991 PR other/17991

View File

@ -30,9 +30,6 @@ Boston, MA 02111-1307, USA. */
#define BAD_ADDR ((void*)-1) #define BAD_ADDR ((void*)-1)
#endif #endif
#if ! defined( SIGCHLD ) && defined( SIGCLD )
# define SIGCHLD SIGCLD
#endif
#ifndef SEPARATE_FIX_PROC #ifndef SEPARATE_FIX_PROC
#include "server.h" #include "server.h"
#endif #endif
@ -291,12 +288,8 @@ initialize ( int argc, char** argv )
# endif # endif
signal (SIGQUIT, SIG_IGN); signal (SIGQUIT, SIG_IGN);
#ifdef SIGIOT
signal (SIGIOT, SIG_IGN); signal (SIGIOT, SIG_IGN);
#endif
#ifdef SIGPIPE
signal (SIGPIPE, SIG_IGN); signal (SIGPIPE, SIG_IGN);
#endif
signal (SIGALRM, SIG_IGN); signal (SIGALRM, SIG_IGN);
signal (SIGTERM, SIG_IGN); signal (SIGTERM, SIG_IGN);
} }
@ -552,7 +545,11 @@ create_file (void)
*pz_dir = NUL; *pz_dir = NUL;
if (stat (fname, &stbf) < 0) if (stat (fname, &stbf) < 0)
{ {
#ifdef _WIN32
mkdir (fname);
#else
mkdir (fname, S_IFDIR | S_DIRALL); mkdir (fname, S_IFDIR | S_DIRALL);
#endif
} }
*pz_dir = '/'; *pz_dir = '/';
@ -835,8 +832,8 @@ internal_fix (int read_fd, tFixDesc* p_fixd)
* Make the fd passed in the stdin, and the write end of * Make the fd passed in the stdin, and the write end of
* the new pipe become the stdout. * the new pipe become the stdout.
*/ */
fcntl (fd[1], F_DUPFD, STDOUT_FILENO); dup2 (fd[1], STDOUT_FILENO);
fcntl (read_fd, F_DUPFD, STDIN_FILENO); dup2 (read_fd, STDIN_FILENO);
apply_fix (p_fixd, pz_curr_file); apply_fix (p_fixd, pz_curr_file);
exit (0); exit (0);

View File

@ -3,7 +3,7 @@
files which are fixed to work correctly with ANSI C and placed in a files which are fixed to work correctly with ANSI C and placed in a
directory that GCC will search. directory that GCC will search.
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
@ -40,6 +40,26 @@ Boston, MA 02111-1307, USA. */
# define STDOUT_FILENO 1 # define STDOUT_FILENO 1
#endif #endif
#if ! defined( SIGCHLD ) && defined( SIGCLD )
# define SIGCHLD SIGCLD
#endif
#ifndef SIGQUIT
#define SIGQUIT SIGTERM
#endif
#ifndef SIGIOT
#define SIGIOT SIGTERM
#endif
#ifndef SIGPIPE
#define SIGPIPE SIGTERM
#endif
#ifndef SIGALRM
#define SIGALRM SIGTERM
#endif
#ifndef SIGKILL
#define SIGKILL SIGTERM
#endif
typedef int t_success; typedef int t_success;
#define FAILURE (-1) #define FAILURE (-1)

View File

@ -2,7 +2,7 @@
/* /*
* server.c Set up and handle communications with a server process. * server.c Set up and handle communications with a server process.
* *
* Server Handling copyright 1992-1999 The Free Software Foundation * Server Handling copyright 1992-1999, 2004 The Free Software Foundation
* *
* Server Handling is free software. * Server Handling is free software.
* You may redistribute it and/or modify it under the terms of the * You may redistribute it and/or modify it under the terms of the
@ -155,8 +155,8 @@ chain_open (int stdin_fd, tCC** pp_args, pid_t* p_child)
* Make the fd passed in the stdin, and the write end of * Make the fd passed in the stdin, and the write end of
* the new pipe become the stdout. * the new pipe become the stdout.
*/ */
fcntl (stdout_pair.write_fd, F_DUPFD, STDOUT_FILENO); dup2 (stdout_pair.write_fd, STDOUT_FILENO);
fcntl (stdin_fd, F_DUPFD, STDIN_FILENO); dup2 (stdin_fd, STDIN_FILENO);
if (*pp_args == (char *) NULL) if (*pp_args == (char *) NULL)
*pp_args = pz_cmd; *pp_args = pz_cmd;