This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
minor error reporting patch
- To: java at gcc dot gnu dot org
- Subject: minor error reporting patch
- From: David Brownell <david-b at pacbell dot net>
- Date: Mon, 25 Jun 2001 13:13:35 -0700
Running that API test suite, I noticed that file open errors
gave a different exception string. That shouldn't be a
big deal, except that since Java doesn't really provide good
ways to distinguish many errors except by such strings,
programs often end up needing to compare them.
Anyway, here's a way to get rid of that needless difference.
- Dave
--- natFdOrig.cc Mon Jun 25 11:14:44 2001
+++ natFileDescriptorPosix.cc Mon Jun 25 11:15:17 2001
@@ -111,7 +111,7 @@
if (fd == -1)
{
char msg[MAXPATHLEN + 200];
- sprintf (msg, "%s: %s", buf, strerror (errno));
+ sprintf (msg, "%s (%s)", buf, strerror (errno));
JvThrow (new FileNotFoundException (JvNewStringLatin1 (msg)));
}
return fd;