aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-03-16 06:04:33 +0000
committerRichard Stallman <rms@gnu.org>1993-03-16 06:04:33 +0000
commitc6469b460a0cdbf626ea8c961324aabd1e6a40b8 (patch)
treed43dabd97fa807da566ade2d265344f4654698bd /gcc
parentaf2cc4dd6953054b4a1d068dc5bffeeb6170f37b (diff)
downloadgcc-c6469b460a0cdbf626ea8c961324aabd1e6a40b8.zip
gcc-c6469b460a0cdbf626ea8c961324aabd1e6a40b8.tar.gz
gcc-c6469b460a0cdbf626ea8c961324aabd1e6a40b8.tar.bz2
(main): Report errors in output to pcp_outfile.
(write_output): Use pfatal_with_name for errors. From-SVN: r3755
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cccp.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c
index a1b25f8..b6daed9 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -1905,6 +1905,10 @@ main (argc, argv)
}
}
+ if (pcp_outfile && pcp_outfile != stdout
+ && (ferror (pcp_outfile) || fclose (pcp_outfile) != 0))
+ fatal ("I/O error on `-pcp' output");
+
if (ferror (stdout) || fclose (stdout) != 0)
fatal ("I/O error on output");
@@ -4687,9 +4691,9 @@ write_output ()
sprintf (line_command, "\n# %d \"%s\"\n",
next_string->lineno, next_string->filename);
if (write (fileno (stdout), line_command, strlen (line_command)) < 0)
- perror_with_name (out_fname);
+ pfatal_with_name (out_fname);
if (write (fileno (stdout), next_string->contents, next_string->len) < 0)
- perror_with_name (out_fname);
+ pfatal_with_name (out_fname);
}
next_string = next_string->chain;
}
@@ -4700,7 +4704,7 @@ write_output ()
: outbuf.bufp - cur_buf_loc);
if (write (fileno (stdout), cur_buf_loc, len) < len)
- perror_with_name (out_fname);
+ pfatal_with_name (out_fname);
cur_buf_loc += len;
}
}