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

Add a truncate(2) wrapper #956

Merged
merged 1 commit into from Oct 19, 2018
Merged

Add a truncate(2) wrapper #956

merged 1 commit into from Oct 19, 2018

Conversation

@jmmv
Copy link
Contributor

jmmv commented Oct 17, 2018

This also adds a test for truncate (obviously) but, while doing so, also
adds a test for the already-existing ftruncate.

}
}));

Errno::result(res).map(drop)

This comment has been minimized.

Copy link
@asomers

asomers Oct 17, 2018

Member

I prefer map(|| ()) for stylistic reasons. drop, in this context, is basically being called for its side effect of returning nothing.

This comment has been minimized.

Copy link
@jmmv

jmmv Oct 17, 2018

Author Contributor

I'm not exactly sure what you'd like to see here, but given that this is a copy/paste from the many, many other functions that follow this style, I think keeping this for consistency is good.

test/test_unistd.rs Outdated Show resolved Hide resolved
This also adds a test for truncate (obviously) but, while doing so, also
adds a test for the already-existing ftruncate.
@jmmv jmmv force-pushed the jmmv:truncate branch from 539e26f to 1f817c7 Oct 17, 2018
Copy link
Member

asomers left a comment

bors r+

bors bot added a commit that referenced this pull request Oct 19, 2018
Merge #956
956: Add a truncate(2) wrapper r=asomers a=jmmv

This also adds a test for truncate (obviously) but, while doing so, also
adds a test for the already-existing ftruncate.

Co-authored-by: Julio Merino <julio@meroh.net>
@bors

This comment has been minimized.

@bors bors bot merged commit 1f817c7 into nix-rust:master Oct 19, 2018
4 checks passed
4 checks passed
bors Build succeeded
Details
buildbot/nix-rust/nix amd64_fbsd11 Build done.
Details
buildbot/nix-rust/nix i386_fbsd11 Build done.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jmmv jmmv deleted the jmmv:truncate branch Oct 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.