HDFS-12013: libhdfs++: read with offset at EOF should return 0 bytes instead of error. Contributed by Xiaowei Zhu
This commit is contained in:
parent
c5e7a69523
commit
3c743b475e
@ -181,7 +181,10 @@ void FileHandleImpl::AsyncPreadSome(
|
||||
return;
|
||||
}
|
||||
|
||||
if(offset >= file_info_->file_length_){
|
||||
if(offset == file_info_->file_length_) {
|
||||
handler(Status::OK(), "", 0);
|
||||
return;
|
||||
} else if(offset > file_info_->file_length_){
|
||||
handler(Status::InvalidOffset("AsyncPreadSome: trying to begin a read past the EOF"), "", 0);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user