From: Jim Wilson Date: Tue, 12 Jan 1993 22:52:37 +0000 (-0800) Subject: (main): Set signal handler for SIGPIPE. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9e263fc414bf87288f0c278dfffb30d21e8ad02d;p=gcc.git (main): Set signal handler for SIGPIPE. (pipe_closed): New function, to handle SIGPIPE. From-SVN: r3205 --- diff --git a/gcc/cccp.c b/gcc/cccp.c index d3d4727369f..1036414f865 100644 --- a/gcc/cccp.c +++ b/gcc/cccp.c @@ -75,6 +75,7 @@ typedef unsigned char U_CHAR; #include #include #include +#include #ifndef VMS #ifndef USG @@ -248,6 +249,7 @@ static void fatal (); void fancy_abort (); static void pfatal_with_name (); static void perror_with_name (); +static void pipe_closed (); static void print_containing_files (); static int lookup_import (); static int redundant_include_p (); @@ -983,6 +985,8 @@ main (argc, argv) } #endif /* RLIMIT_STACK defined */ + signal (SIGPIPE, pipe_closed); + progname = argv[0]; #ifdef VMS { @@ -8662,6 +8666,15 @@ pfatal_with_name (name) #endif } +/* Handler for SIGPIPE. */ + +static void +pipe_closed (signo) + /* If this is missing, some compilers complain. */ + int signo; +{ + fatal ("output pipe has been closed"); +} static void memory_full ()