-
Notifications
You must be signed in to change notification settings - Fork 288
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
Small cleanups for copy_file sendfile fix #544
Conversation
@@ -2898,6 +2898,8 @@ namespace vcpkg | |||
return true; | |||
#else // ^^^ (defined(__APPLE__) // !defined(__APPLE__) vvv | |||
|
|||
destination_fd.fchmod(source_stat.st_mode, ec); |
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.
This is now generally before writing the output and for some paths before reading ec
, instead of immediately before returning. IMO this is a behavioural change, not deduplication.
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.
Perhaps, but is there a need to delay the fchmod until the end, requiring the duplication?
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.
Maybe it is really an improvement ;-)
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 think this change LGTM, but it needs to add a check for ec
and an early failure if the fchmod
failed. Failure to change permissions but success in copying the data doesn't sound like a successful copy to me :)
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.
Thanks that's a good point, I pushed a change.
@@ -2898,6 +2898,8 @@ namespace vcpkg | |||
return true; | |||
#else // ^^^ (defined(__APPLE__) // !defined(__APPLE__) vvv | |||
|
|||
destination_fd.fchmod(source_stat.st_mode, ec); |
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 think this change LGTM, but it needs to add a check for ec
and an early failure if the fchmod
failed. Failure to change permissions but success in copying the data doesn't sound like a successful copy to me :)
Cleanups for #543