Skip to content

Commit ad50845

Browse files
committed
Respond to review comments
1 parent 5fc7d92 commit ad50845

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ The following targets are supported by `nix`:
105105

106106
## Minimum Supported Rust Version (MSRV)
107107

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

111111
## Contributing

src/mount/bsd.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,11 @@ impl<'a> Nmount<'a> {
396396
match Errno::result(res) {
397397
Ok(_) => Ok(()),
398398
Err(error) => {
399-
let errmsg = CStr::from_bytes_until_nul(&errmsg[..]).ok();
399+
let errmsg = if errmsg[0] == 0 {
400+
None
401+
} else {
402+
CStr::from_bytes_until_nul(&errmsg[..]).ok()
403+
};
400404
Err(NmountError::new(error, errmsg))
401405
}
402406
}

src/sys/prctl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ pub fn get_name() -> Result<CString> {
151151

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

154-
Errno::result(res).map(|_| {
154+
Errno::result(res).and_then(|_| {
155155
CStr::from_bytes_until_nul(&buf)
156156
.map(CStr::to_owned)
157157
.map_err(|_| Errno::EINVAL)
158-
}).flatten()
158+
})
159159
}
160160

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

0 commit comments

Comments
 (0)