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

Correct types of mode bit constants on Fuchsia #3654

Merged
merged 2 commits into from
Apr 16, 2024

Conversation

djkoloski
Copy link
Contributor

Fuchsia's definitions of these constants were split from the unix impls before #503, and so S_ISUID, S_ISGID, and S_ISVTX are all incorrectly typed as c_int instead of mode_t. This applies the same fix to Fuchsia's constant definitions to bring them in line with the rest of libc.

This is a breaking change since c_int is i32 on Fuchsia and mode_t is u32, but it's a good breaking change.

@rustbot
Copy link
Collaborator

rustbot commented Apr 9, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@workingjubilee
Copy link
Member

Thanks for taking a look at this!

I think we should accept this, despite its nominal breaking change status, as this in-principle is the same change as #503 which was also breaking and also accepted-already. Code that currently builds and works on Fuchsia has to type-cast around this somehow anyways.

src/fuchsia/mod.rs Outdated Show resolved Hide resolved
David Koloski and others added 2 commits April 16, 2024 17:57
Fuchsia's definitions of these constants were split from the unix impls
before rust-lang#503, and so S_ISUID, S_ISGID, and S_ISVTX are all incorrectly
typed as c_int instead of mode_t. This applies the same fix to Fuchsia's
constant definitions to bring them in line with the rest of libc.
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
@JohnTitor JohnTitor force-pushed the correct_fuchsia_mode_constants branch from 571f810 to 0338155 Compare April 16, 2024 08:57
@JohnTitor JohnTitor added this pull request to the merge queue Apr 16, 2024
Merged via the queue into rust-lang:main with commit 005ae8d Apr 16, 2024
41 checks passed
github-merge-queue bot pushed a commit that referenced this pull request Jun 16, 2024
[0.2] Backport #3654 "Correct types of mode bit constants on Fuchsia"
@tgross35 tgross35 added the stable-applied This PR has been cherry-picked to libc's stable release branch label Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review stable-applied This PR has been cherry-picked to libc's stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants