diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/bindings/c/hdfs.cc b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/bindings/c/hdfs.cc index 85f29d8eb6..03f3140c26 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/bindings/c/hdfs.cc +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/bindings/c/hdfs.cc @@ -134,10 +134,8 @@ static int Error(const Status &stat) { default_message = "Operation canceled"; break; case Status::Code::kPermissionDenied: - if (!stat.ToString().empty()) - ReportError(EACCES, stat.ToString().c_str()); - else - ReportError(EACCES, "Permission denied"); + errnum = EACCES; + default_message = "Permission denied"; break; default: errnum = ENOSYS;