-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return code rework #391
Return code rework #391
Conversation
so make ::pwrite return an int
instead of throwing an exception, as with writeOneBlock
instead of throwing an exception, as with read/write
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the work @vgough 👍
I just reviewed and made 2 comments below (shown by GitHub as outdated but here they are).
Thanks !
encfs/RawFileIO.cpp
Outdated
// never know... | ||
return -eno; | ||
} | ||
if (writeSize == 0) { | ||
return -EIO; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we return EIO
we loose a chance to return correct errno
: depending on implementations pwrite
could set errno
when it returns 0.
This is why I tested if (writeSize <= 0)
in my initial commit.
Could we then get back to previous version here ?
Many thanks 👍
encfs/RawFileIO.cpp
Outdated
@@ -206,8 +209,6 @@ ssize_t RawFileIO::read(const IORequest &req) const { | |||
|
|||
if (readSize < 0) { | |||
int eno = errno; | |||
errno = 0; // just to be sure error seen in integration tests really comes | |||
// from the function rc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have been pleased to keep this, as explained in the comment just to be sure...
Thank you 👍
This takes #380, eliminates mutation of errno, fixes formatting and fixes clang-tidy warnings.