minor error reporting patch
David Brownell
david-b@pacbell.net
Mon Jun 25 13:24:00 GMT 2001
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;
More information about the Java
mailing list