aboutsummaryrefslogtreecommitdiff
path: root/gcc/ggc-common.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/ggc-common.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/ggc-common.c')
-rw-r--r--gcc/ggc-common.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c
index db8cbd03207..adf2fd0decb 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);