Skip to content

Commit

Permalink
ENH: Convert errno to string error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Licht-T committed Nov 1, 2017
1 parent 6ed9287 commit db7ef3a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cpp/src/arrow/io/file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ static inline Status FileRead(int fd, uint8_t* buffer, int64_t nbytes,
#endif

if (*bytes_read == -1) {
// TODO(wesm): errno to string
return Status::IOError("Error reading bytes from file");
return Status::IOError(std::string("Error reading bytes from file: ") +
std::string(strerror(errno)));
}

return Status::OK();
Expand All @@ -293,8 +293,8 @@ static inline Status FileWrite(int fd, const uint8_t* buffer, int64_t nbytes) {
#endif

if (ret == -1) {
// TODO(wesm): errno to string
return Status::IOError("Error writing bytes to file");
return Status::IOError(std::string("Error writing bytes from file: ") +
std::string(strerror(errno)));
}
return Status::OK();
}
Expand Down

0 comments on commit db7ef3a

Please sign in to comment.