From c14bb5768ef6046d2a573d9ea6511bf8e27f20b8 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Fri, 21 Aug 2009 09:23:03 -0600 Subject: [PATCH] throw FileNotFoundException from doOpen when appropriate --- classpath/java-io.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/classpath/java-io.cpp b/classpath/java-io.cpp index 9fbf2087bb..868c449062 100644 --- a/classpath/java-io.cpp +++ b/classpath/java-io.cpp @@ -67,7 +67,11 @@ doOpen(JNIEnv* e, const char* path, int mask) { int fd = OPEN(path, mask | OPEN_MASK, S_IRUSR | S_IWUSR); if (fd == -1) { - throwNew(e, "java/io/IOException", strerror(errno)); + if (errno == ENOENT) { + throwNew(e, "java/io/FileNotFoundException", strerror(errno)); + } else { + throwNew(e, "java/io/IOException", strerror(errno)); + } } return fd; }