Permalink
Browse files

Correct some error messages for efile

  • Loading branch information...
1 parent 8683c92 commit 6199cc89e32174d3fa774794b4dfd7ac34692017 @krestenkrab krestenkrab committed Oct 6, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/main/java/erjang/driver/efile/EFile.java
@@ -1431,6 +1431,8 @@ public void run() {
posix_errno = Posix.ENOENT;
} else if (Posix.isCWD(name, file)) {
posix_errno = Posix.EINVAL;
+ } else if (!file.isDirectory()) {
+ posix_errno = Posix.ENOTDIR;
} else if (file.exists()) {
posix_errno = Posix.EEXIST;
} else {
@@ -1475,6 +1477,8 @@ public void run() {
if (!result_ok) {
if (!file.exists()) {
posix_errno = Posix.ENOENT;
+ } else if (!file.canWrite()) {
+ posix_errno = Posix.EPERM;
} else if (file.isDirectory()) {
posix_errno = Posix.EEXIST;
} else {

0 comments on commit 6199cc8

Please sign in to comment.