mirror of
https://github.com/facebookexperimental/reverie.git
synced 2025-01-23 05:06:23 +00:00
reverie-process: Fix remaining unnecessary usage of unsafe
Summary: Missed these in a previous diff. Reviewed By: rrnewton Differential Revision: D41567346 fbshipit-source-id: eba0b738a66da1823312803ed91fdc5eeaf90c57
This commit is contained in:
parent
42a87f915e
commit
8058dd4803
1 changed files with 2 additions and 2 deletions
|
@ -54,7 +54,7 @@ impl Fd {
|
|||
/// allocate.
|
||||
pub fn open_c(path: *const libc::c_char, flags: i32) -> Result<Self, Errno> {
|
||||
let fd = Errno::result(unsafe { libc::open(path, flags) })?;
|
||||
Ok(unsafe { Self(fd) })
|
||||
Ok(Self(fd))
|
||||
}
|
||||
|
||||
/// Creates a file from a NUL terminated string. This function does not allocate.
|
||||
|
@ -320,7 +320,7 @@ pub fn pipe() -> Result<(Fd, Fd), Errno> {
|
|||
// descriptor won't be closed upon exec.
|
||||
Errno::result(unsafe { libc::pipe2(fds.as_mut_ptr(), libc::O_CLOEXEC) })?;
|
||||
|
||||
Ok((unsafe { Fd(fds[0]) }, unsafe { Fd(fds[1]) }))
|
||||
Ok((Fd(fds[0]), Fd(fds[1])))
|
||||
}
|
||||
|
||||
/// Writes bytes to a file. The file path must be null terminated.
|
||||
|
|
Loading…
Reference in a new issue