git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HADOOP-10388@1609276 13f79535-47bb-0310-9956-ffa450edef68
@@ -1382,7 +1382,7 @@ static int jni_unlink(hdfsFS bfs, const char *path, int recursive)
return -1;
}
if (!jVal.z) {
- errno = EIO;
+ errno = ENOENT;
return 0;
@@ -593,6 +593,11 @@ static int ndfs_unlink(struct hdfs_internal *bfs,
if (err) {
goto done;
+ if (resp->result == 0) {
+ err = hadoop_lerr_alloc(ENOENT, "ndfs_unlink(%s, recursive=%d): "
+ "deletion failed on the server", uri, recursive);
+ goto done;
+ }
done:
free(path);