aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-pch.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@codesourcery.com>2003-05-13 18:06:52 +0000
committerZack Weinberg <zack@codesourcery.com>2003-05-13 18:06:52 +0000
commitb4ea2f20c9d19e49ee27d761eb86a2d1a381ada5 (patch)
treefd24969394b3b9dffb1cc037cebd35f54276e5b8 /gcc/c-pch.c
parent6e667526d47096505de9c990a75fd44509a9e92e (diff)
* diagnostic.c (output_format): Add support for %m.
(output_printf, output_verbatim, diagnostic_set_info, verbatim): Set err_no field of the text_info structure being initialized. (fatal_io_error): Delete function. * diagnostic.h (text_info): Add err_no field. * toplev.h (fatal_io_error): Delete prototype. * c-opts.c, c-pch.c, dwarfout.c, ggc-common.c, ggc-page.c, graph.c * toplev.c, config/mips/mips.c, config/rs6000/host-darwin.c * f/com.c, java/jcf-parse.c, java/jcf-write.c, java/lex.c * objc/objc-act.c: Replace all calls to fatal_io_error with calls to fatal_error; add ": %m" to the end of all the affected error messages. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@66769 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-pch.c')
-rw-r--r--gcc/c-pch.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/gcc/c-pch.c b/gcc/c-pch.c
index a7fa879fb88..354fcc7849b 100644
--- a/gcc/c-pch.c
+++ b/gcc/c-pch.c
@@ -86,13 +86,13 @@ pch_init ()
f = fopen (pch_file, "w+b");
if (f == NULL)
- fatal_io_error ("can't open %s", pch_file);
+ fatal_error ("can't open %s: %m", pch_file);
pch_outfile = f;
v.debug_info_type = write_symbols;
if (fwrite (get_ident(), IDENT_LENGTH, 1, f) != 1
|| fwrite (&v, sizeof (v), 1, f) != 1)
- fatal_io_error ("can't write to %s", pch_file);
+ fatal_error ("can't write to %s: %m", pch_file);
/* We need to be able to re-read the output. */
/* The driver always provides a valid -o option. */
@@ -127,13 +127,13 @@ c_common_write_pch ()
h.asm_size = asm_file_end - asm_file_startpos;
if (fwrite (&h, sizeof (h), 1, pch_outfile) != 1)
- fatal_io_error ("can't write %s", pch_file);
+ fatal_error ("can't write %s: %m", pch_file);
buf = xmalloc (16384);
fflush (asm_out_file);
if (fseek (asm_out_file, asm_file_startpos, SEEK_SET) != 0)
- fatal_io_error ("can't seek in %s", asm_file_name);
+ fatal_error ("can't seek in %s: %m", asm_file_name);
for (written = asm_file_startpos; written < asm_file_end; )
{
@@ -141,9 +141,9 @@ c_common_write_pch ()
if (size > 16384)
size = 16384;
if (fread (buf, size, 1, asm_out_file) != 1)
- fatal_io_error ("can't read %s", asm_file_name);
+ fatal_error ("can't read %s: %m", asm_file_name);
if (fwrite (buf, size, 1, pch_outfile) != 1)
- fatal_io_error ("can't write %s", pch_file);
+ fatal_error ("can't write %s: %m", pch_file);
written += size;
}
free (buf);
@@ -177,10 +177,7 @@ c_common_valid_pch (pfile, name, fd)
sizeread = read (fd, ident, IDENT_LENGTH);
if (sizeread == -1)
- {
- fatal_io_error ("can't read %s", name);
- return 2;
- }
+ fatal_error ("can't read %s: %m", name);
else if (sizeread != IDENT_LENGTH)
return 2;
@@ -206,10 +203,7 @@ c_common_valid_pch (pfile, name, fd)
}
if (read (fd, &v, sizeof (v)) != sizeof (v))
- {
- fatal_io_error ("can't read %s", name);
- return 2;
- }
+ fatal_error ("can't read %s: %m", name);
/* The allowable debug info combinations are that either the PCH file
was built with the same as is being used now, or the PCH file was