Skip to content
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

Remove an undocumented assumption that O_RDONLY == 0 #1343

Merged
merged 1 commit into from
Sep 14, 2022

Conversation

mtrmac
Copy link
Collaborator

@mtrmac mtrmac commented Sep 14, 2022

There's at least one Go platform where that is not true.

Making that assumption without any warning is just a trap for future readers.

Instead, just do the obviously correct thing, per the API documentation.

On macOS, this compiles to literally exactly the same binary code.

So, let the compiler be clever so that we don't have to.

@mtrmac mtrmac mentioned this pull request Sep 14, 2022
There's at least one Go platform where that is not true.

Making that assumption without any warning is just a trap for future readers.

Instead, just do the obviously correct thing, per the API documentation.

On macOS, this compiles to _literally exactly the same binary code_.

So, let the compiler be clever so that we don't have to.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
@rhatdan
Copy link
Member

rhatdan commented Sep 14, 2022

LGTM

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@giuseppe giuseppe merged commit 93b09d5 into containers:main Sep 14, 2022
@mtrmac mtrmac deleted the dont-be-too-clever branch September 14, 2022 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants