Skip to content
This repository has been archived by the owner on Apr 13, 2022. It is now read-only.

Use errno from the standard library #1

Merged
merged 2 commits into from
Feb 28, 2018
Merged

Conversation

tomaka
Copy link

@tomaka tomaka commented Feb 28, 2018

Use the errno capabilities of the Rust standard library instead of having platform-specific code.

The code was grabbed from this PR: knsd#23
Since the author has deleted their repo, I just copy-pasted the code instead of picking the commit.

src/lib.rs Outdated
@@ -110,6 +111,10 @@ pub enum DaemonizeError {
__Nonexhaustive,
}

fn errno() -> Errno {
io::Error::last_os_error().raw_os_error().unwrap()

Choose a reason for hiding this comment

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

Can we have expect("last_os_error produces only OS errors hence raw_os_error cannot be None") instead of unwrap?

@tomaka tomaka merged commit df00295 into paritytech:master Feb 28, 2018
@tomaka tomaka deleted the fix-errno branch February 28, 2018 17:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants