Skip to content

Commit

Permalink
Respond to review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
asomers committed Oct 2, 2023
1 parent 5fc7d92 commit ad50845
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ The following targets are supported by `nix`:

## Minimum Supported Rust Version (MSRV)

nix is supported on Rust 1.65 and higher. Its MSRV will not be
nix is supported on Rust 1.69 and higher. Its MSRV will not be
changed in the future without bumping the major or minor version.

## Contributing
Expand Down
6 changes: 5 additions & 1 deletion src/mount/bsd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,11 @@ impl<'a> Nmount<'a> {
match Errno::result(res) {
Ok(_) => Ok(()),
Err(error) => {
let errmsg = CStr::from_bytes_until_nul(&errmsg[..]).ok();
let errmsg = if errmsg[0] == 0 {
None
} else {
CStr::from_bytes_until_nul(&errmsg[..]).ok()
};
Err(NmountError::new(error, errmsg))
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/sys/prctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ pub fn get_name() -> Result<CString> {

let res = unsafe { libc::prctl(libc::PR_GET_NAME, &buf, 0, 0, 0) };

Errno::result(res).map(|_| {
Errno::result(res).and_then(|_| {
CStr::from_bytes_until_nul(&buf)
.map(CStr::to_owned)
.map_err(|_| Errno::EINVAL)
}).flatten()
})
}

/// Sets the timer slack value for the calling thread. Timer slack is used by the kernel to group
Expand Down

0 comments on commit ad50845

Please sign in to comment.