From fa6ef81367f0c24ec0b04e753313cdb023e10217 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Tue, 13 May 2003 18:06:52 +0000 Subject: 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 --- gcc/ggc-common.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'gcc/ggc-common.c') diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c index db8cbd0..adf2fd0 100644 --- a/gcc/ggc-common.c +++ b/gcc/ggc-common.c @@ -411,7 +411,7 @@ write_pch_globals (tab, state) { if (fwrite (&ptr, sizeof (void *), 1, state->f) != 1) - fatal_io_error ("can't write PCH file"); + fatal_error ("can't write PCH file: %m"); } else { @@ -419,7 +419,7 @@ write_pch_globals (tab, state) POINTER_HASH (ptr)); if (fwrite (&new_ptr->new_addr, sizeof (void *), 1, state->f) != 1) - fatal_io_error ("can't write PCH file"); + fatal_error ("can't write PCH file: %m"); } } } @@ -496,7 +496,7 @@ gt_pch_save (f) for (rt = gt_pch_scalar_rtab; *rt; rt++) for (rti = *rt; rti->base != NULL; rti++) if (fwrite (rti->base, rti->stride, 1, f) != 1) - fatal_io_error ("can't write PCH file"); + fatal_error ("can't write PCH file: %m"); /* Write out all the global pointers, after translation. */ write_pch_globals (gt_ggc_rtab, &state); @@ -509,17 +509,17 @@ gt_pch_save (f) long o; o = ftell (state.f) + sizeof (mmi); if (o == -1) - fatal_io_error ("can't get position in PCH file"); + fatal_error ("can't get position in PCH file: %m"); mmi.offset = page_size - o % page_size; if (mmi.offset == page_size) mmi.offset = 0; mmi.offset += o; } if (fwrite (&mmi, sizeof (mmi), 1, state.f) != 1) - fatal_io_error ("can't write PCH file"); + fatal_error ("can't write PCH file: %m"); if (mmi.offset != 0 && fseek (state.f, mmi.offset, SEEK_SET) != 0) - fatal_io_error ("can't write padding to PCH file"); + fatal_error ("can't write padding to PCH file: %m"); /* Actually write out the objects. */ for (i = 0; i < state.count; i++) @@ -572,7 +572,7 @@ gt_pch_restore (f) for (rt = gt_pch_scalar_rtab; *rt; rt++) for (rti = *rt; rti->base != NULL; rti++) if (fread (rti->base, rti->stride, 1, f) != 1) - fatal_io_error ("can't read PCH file"); + fatal_error ("can't read PCH file: %m"); /* Read in all the global pointers, in 6 easy loops. */ for (rt = gt_ggc_rtab; *rt; rt++) @@ -580,17 +580,17 @@ gt_pch_restore (f) for (i = 0; i < rti->nelt; i++) if (fread ((char *)rti->base + rti->stride * i, sizeof (void *), 1, f) != 1) - fatal_io_error ("can't read PCH file"); + fatal_error ("can't read PCH file: %m"); for (rt = gt_pch_cache_rtab; *rt; rt++) for (rti = *rt; rti->base != NULL; rti++) for (i = 0; i < rti->nelt; i++) if (fread ((char *)rti->base + rti->stride * i, sizeof (void *), 1, f) != 1) - fatal_io_error ("can't read PCH file"); + fatal_error ("can't read PCH file: %m"); if (fread (&mmi, sizeof (mmi), 1, f) != 1) - fatal_io_error ("can't read PCH file"); + fatal_error ("can't read PCH file: %m"); #if HAVE_MMAP_FILE addr = mmap (mmi.preferred_base, mmi.size, @@ -604,10 +604,10 @@ gt_pch_restore (f) addr = xmalloc (mmi.size); if (fseek (f, mmi.offset, SEEK_SET) != 0 || fread (&mmi, mmi.size, 1, f) != 1) - fatal_io_error ("can't read PCH file"); + fatal_error ("can't read PCH file: %m"); } else if (fseek (f, mmi.offset + mmi.size, SEEK_SET) != 0) - fatal_io_error ("can't read PCH file"); + fatal_error ("can't read PCH file: %m"); ggc_pch_read (f, addr); -- cgit v1.1