This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

minor error reporting patch


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;



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]