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

exec family functions take CString instead of &CStr #1093

Closed
canndrew opened this issue Jun 27, 2019 · 1 comment
Closed

exec family functions take CString instead of &CStr #1093

canndrew opened this issue Jun 27, 2019 · 1 comment

Comments

@canndrew
Copy link

For example, the signature of execve is:

pub fn execve(path: &CString, args: &[CString], env: &[CString]) -> Result<Void>

Surely there's no point in taking a &CString as opposed to a &CStr, right? And couldn't the slices just contain &CStrs since it's not possible to move out of a slice anyway?

@asomers
Copy link
Member

asomers commented Jun 27, 2019

Yep, there's very rarely a reason for a &CString. Would you care to submit a PR to fix it?

tathanhdinh added a commit to tathanhdinh/nix that referenced this issue Sep 6, 2019
@tathanhdinh tathanhdinh mentioned this issue Sep 6, 2019
tathanhdinh added a commit to tathanhdinh/nix that referenced this issue Sep 6, 2019
tathanhdinh added a commit to tathanhdinh/nix that referenced this issue Sep 6, 2019
tathanhdinh added a commit to tathanhdinh/nix that referenced this issue Sep 14, 2019
bors bot added a commit that referenced this issue Sep 28, 2019
1121: Fix #1093 r=asomers a=tathanhdinh

Hello,
This PR fixes the problem discovered in #1093.
Thanks for any comment.

1130: unistd: getgrouplist: Rework code to use `reserve_double_buffer_size` r=asomers a=otavio

The buffer resize logic can be simplified reusing the
`reserve_double_buffer_size` method.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>

Co-authored-by: Ta Thanh Dinh <tathanhdinh@gmail.com>
Co-authored-by: Otavio Salvador <otavio@ossystems.com.br>
@bors bors bot closed this as completed in 9ebc633 Sep 28, 2019
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

No branches or pull requests

2 participants