diff options
author | Zack Weinberg <zack@codesourcery.com> | 2003-05-13 18:06:52 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2003-05-13 18:06:52 +0000 |
commit | fa6ef81367f0c24ec0b04e753313cdb023e10217 (patch) | |
tree | fd24969394b3b9dffb1cc037cebd35f54276e5b8 /gcc/c-pch.c | |
parent | 3bec3c0c9cadc98f39f7072cb77a1c1b90ada59b (diff) | |
download | gcc-fa6ef81367f0c24ec0b04e753313cdb023e10217.tar.gz |
diagnostic.c (output_format): Add support for %m.
* 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.
From-SVN: r66769
Diffstat (limited to 'gcc/c-pch.c')
-rw-r--r-- | gcc/c-pch.c | 22 |
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 |