summaryrefslogtreecommitdiffstats
path: root/gcc/java
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-13 18:06:52 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-13 18:06:52 +0000
commitd07c9932fe3d8be3478554d156bf3bf189027339 (patch)
treefd24969394b3b9dffb1cc037cebd35f54276e5b8 /gcc/java
parenta82984ec82161ff946c0e260660fbbcbdad83b28 (diff)
downloadppe42-gcc-d07c9932fe3d8be3478554d156bf3bf189027339.tar.gz
ppe42-gcc-d07c9932fe3d8be3478554d156bf3bf189027339.zip
* 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: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66769 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog6
-rw-r--r--gcc/java/jcf-parse.c12
-rw-r--r--gcc/java/jcf-write.c8
-rw-r--r--gcc/java/lex.c2
4 files changed, 17 insertions, 11 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index b4e13f35790..679636f7bb1 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,9 @@
+2003-05-13 Zack Weinberg <zack@codesourcery.com>
+
+ * jcf-parse.c, jcf-write.c, lex.c: Replace all calls to
+ fatal_io_error with calls to fatal_error; add ": %m" to the end of
+ all the affected error messages.
+
2003-05-13 Richard Henderson <rth@redhat.com>
* class.c (layout_class_method): Set DECL_EXTERNAL.
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index e3e60cb20c6..2b20537a137 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -513,12 +513,12 @@ read_class (tree name)
if (!HAS_BEEN_ALREADY_PARSED_P (file))
{
if (!(finput = fopen (input_filename, "r")))
- fatal_io_error ("can't reopen %s", input_filename);
+ fatal_error ("can't reopen %s: %m", input_filename);
parse_source_file_1 (file, finput);
parse_source_file_2 ();
parse_source_file_3 ();
if (fclose (finput))
- fatal_io_error ("can't close %s", input_filename);
+ fatal_error ("can't close %s: %m", input_filename);
}
JCF_FINISH (current_jcf);
java_pop_parser_context (generate);
@@ -888,7 +888,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
int avail = 2000;
finput = fopen (input_filename, "r");
if (finput == NULL)
- fatal_io_error ("can't open %s", input_filename);
+ fatal_error ("can't open %s: %m", input_filename);
list = xmalloc(avail);
next = list;
for (;;)
@@ -907,7 +907,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
if (count == 0)
{
if (! feof (finput))
- fatal_io_error ("error closing %s", input_filename);
+ fatal_error ("error closing %s: %m", input_filename);
*next = '\0';
break;
}
@@ -1030,11 +1030,11 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
/* Close previous descriptor, if any */
if (finput && fclose (finput))
- fatal_io_error ("can't close input file %s", main_input_filename);
+ fatal_error ("can't close input file %s: %m", main_input_filename);
finput = fopen (IDENTIFIER_POINTER (name), "rb");
if (finput == NULL)
- fatal_io_error ("can't open %s", IDENTIFIER_POINTER (name));
+ fatal_error ("can't open %s: %m", IDENTIFIER_POINTER (name));
#ifdef IO_BUFFER_SIZE
setvbuf (finput, xmalloc (IO_BUFFER_SIZE),
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index 59ef514edb4..0d8f73ee13e 100644
--- a/gcc/java/jcf-write.c
+++ b/gcc/java/jcf-write.c
@@ -3341,7 +3341,7 @@ make_class_file_name (tree clas)
if (stat (r, &sb) == -1
/* Try to make it. */
&& mkdir (r, 0755) == -1)
- fatal_io_error ("can't create directory %s", r);
+ fatal_error ("can't create directory %s: %m", r);
*s = sep;
/* Skip consecutive separators. */
@@ -3374,14 +3374,14 @@ write_classfile (tree clas)
temporary_file_name = concat (class_file_name, ".tmp", NULL);
stream = fopen (temporary_file_name, "wb");
if (stream == NULL)
- fatal_io_error ("can't open %s for writing", temporary_file_name);
+ fatal_error ("can't open %s for writing: %m", temporary_file_name);
jcf_dependency_add_target (class_file_name);
init_jcf_state (state, work);
chunks = generate_classfile (clas, state);
write_chunks (stream, chunks);
if (fclose (stream))
- fatal_io_error ("error closing %s", temporary_file_name);
+ fatal_error ("error closing %s: %m", temporary_file_name);
/* If a file named by the string pointed to by `new' exists
prior to the call to the `rename' function, the bahaviour
@@ -3394,7 +3394,7 @@ write_classfile (tree clas)
if (rename (temporary_file_name, class_file_name) == -1)
{
remove (temporary_file_name);
- fatal_io_error ("can't create %s", class_file_name);
+ fatal_error ("can't create %s: %m", class_file_name);
}
free (temporary_file_name);
free (class_file_name);
diff --git a/gcc/java/lex.c b/gcc/java/lex.c
index e21bfd649af..b2655facec1 100644
--- a/gcc/java/lex.c
+++ b/gcc/java/lex.c
@@ -1825,7 +1825,7 @@ java_get_line_col (const char *filename ATTRIBUTE_UNUSED,
char *base;
if (!(fp = fopen (filename, "r")))
- fatal_io_error ("can't open %s", filename);
+ fatal_error ("can't open %s: %m", filename);
while (cline != line)
{
OpenPOWER on IntegriCloud