Skip to content

Conversation

@asomers
Copy link
Member

@asomers asomers commented May 16, 2020

Most Nix functions that accept NixPath arguments can't do anything
useful with None. The exceptions (mount and quotactl_sync)
already take explicitly optional arguments.

Also, this changes the behavior of mount with None arguments.
Previously, it would call mount(2) with empty strings for those
arguments. Now, it will use null pointers.

Most Nix functions that accept `NixPath` arguments can't do anything
useful with `None`.  The exceptions (`mount` and `quotactl_sync`)
already take explicitly optional arguments.

Also, this changes the behavior of `mount` with `None` arguments.
Previously, it would call mount(2) with empty strings for those
arguments.  Now, it will use null pointers.
@asomers
Copy link
Member Author

asomers commented May 16, 2020

Supersedes #1236

@baloo
Copy link

baloo commented May 17, 2020

Can confirm it works as expected:

[pid 109788] mount("proc", "/proc", "proc", MS_NOSUID|MS_NODEV|MS_NOEXEC, NULL) = 0

@asomers
Copy link
Member Author

asomers commented May 17, 2020

bors r+

bors bot added a commit that referenced this pull request May 17, 2020
1242: Don't implement `NixPath` for `Option<&P> where P: NixPath` r=asomers a=asomers

Most Nix functions that accept `NixPath` arguments can't do anything
useful with `None`.  The exceptions (`mount` and `quotactl_sync`)
already take explicitly optional arguments.

Also, this changes the behavior of `mount` with `None` arguments.
Previously, it would call mount(2) with empty strings for those
arguments.  Now, it will use null pointers.

Co-authored-by: Alan Somers <[email protected]>
@bors
Copy link
Contributor

bors bot commented May 17, 2020

Build failed:

  • FreeBSD 11.3

@asomers
Copy link
Member Author

asomers commented May 17, 2020

The bors build failed because the VM got usurped.

bors retry

@bors
Copy link
Contributor

bors bot commented May 17, 2020

Build succeeded:

@bors bors bot merged commit 2f78ec2 into nix-rust:master May 17, 2020
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