Skip to content

Add getresuid() and getresgid() to unistd#1430

Merged
bors[bot] merged 1 commit intonix-rust:masterfrom
jerylvaz:getresuid-getresgid
May 31, 2021
Merged

Add getresuid() and getresgid() to unistd#1430
bors[bot] merged 1 commit intonix-rust:masterfrom
jerylvaz:getresuid-getresgid

Conversation

@jerylvaz
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread src/unistd.rs Outdated
Comment thread src/unistd.rs
Comment thread src/unistd.rs Outdated
Comment thread src/unistd.rs Outdated
Comment thread test/test_unistd.rs Outdated
Comment thread test/test_unistd.rs Outdated
@jerylvaz jerylvaz force-pushed the getresuid-getresgid branch 5 times, most recently from 3971a9b to 43e074e Compare April 24, 2021 11:39
@jerylvaz
Copy link
Copy Markdown
Contributor Author

@asomers What should be done with the unrelated test failure?

Comment thread src/unistd.rs Outdated
@jerylvaz jerylvaz force-pushed the getresuid-getresgid branch from 43e074e to b86ffd5 Compare May 2, 2021 13:14
Comment thread src/unistd.rs Outdated
/// - `Err(x)`: libc error code on failure.
///
#[inline]
pub fn getresuid() -> Result<(Uid, Uid, Uid)> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Returning a tuple is a very old fashioned and failure-prone technique. Better to return a structure. That way the meaning is obvious even without consulting the documentation. Something like:

struct ResUid {
    real: Uid,
    effective: Uid,
    saved: uid
}

@jerylvaz jerylvaz force-pushed the getresuid-getresgid branch 2 times, most recently from 9450b0b to ae59760 Compare May 26, 2021 14:29
@asomers
Copy link
Copy Markdown
Member

asomers commented May 30, 2021

Looks good, but you'll have to rebase to fix the CI failure on FreeBSD.

@jerylvaz jerylvaz force-pushed the getresuid-getresgid branch from ae59760 to ef58b0a Compare May 31, 2021 09:15
Comment thread CHANGELOG.md
This project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased] - ReleaseDate
### Added
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please fix the CHANGELOG. There was a merge error, and now there are two "Added" sections.

@jerylvaz jerylvaz force-pushed the getresuid-getresgid branch from ef58b0a to b481a0e Compare May 31, 2021 14:17
Copy link
Copy Markdown
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

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

bors r+

@bors bors bot merged commit 478db7d into nix-rust:master May 31, 2021
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.

2 participants