diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1993-01-12 14:52:37 -0800 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1993-01-12 14:52:37 -0800 |
commit | 9e263fc414bf87288f0c278dfffb30d21e8ad02d (patch) | |
tree | f9ac2321497c07052aa857bec7fc347d3a5257d2 /gcc | |
parent | a7c5971afba533de4a1c555f441ce2f4dee55039 (diff) | |
download | gcc-9e263fc414bf87288f0c278dfffb30d21e8ad02d.zip gcc-9e263fc414bf87288f0c278dfffb30d21e8ad02d.tar.gz gcc-9e263fc414bf87288f0c278dfffb30d21e8ad02d.tar.bz2 |
(main): Set signal handler for SIGPIPE.
(pipe_closed): New function, to handle SIGPIPE.
From-SVN: r3205
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cccp.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -75,6 +75,7 @@ typedef unsigned char U_CHAR; #include <sys/stat.h> #include <ctype.h> #include <stdio.h> +#include <signal.h> #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 () |