diff --git a/src/system/term/mod.rs b/src/system/term/mod.rs index 3ae271c48..5dd8a1dcd 100644 --- a/src/system/term/mod.rs +++ b/src/system/term/mod.rs @@ -65,7 +65,7 @@ impl Pty { Ok(Self { path, leader: PtyLeader { - // SAFETY: `leader` has been set by `openpty` + // SAFETY: `openpty` has set `leader` to an open fd suitable for assuming ownership by `OwnedFd`. file: unsafe { OwnedFd::from_raw_fd(leader) }.into(), }, follower: PtyFollower { @@ -166,7 +166,7 @@ impl Terminal for F { // SAFETY: tcgetpgrp cannot cause UB cerr(unsafe { libc::tcgetpgrp(self.as_raw_fd()) }) } - /// Set the foreground process group ID associated with this terminalto `pgrp`. + /// Set the foreground process group ID associated with this terminal to `pgrp`. fn tcsetpgrp(&self, pgrp: ProcessId) -> io::Result<()> { // SAFETY: tcsetpgrp cannot cause UB cerr(unsafe { libc::tcsetpgrp(self.as_raw_fd(), pgrp) }).map(|_| ()) @@ -189,7 +189,7 @@ impl Terminal for F { } // SAFETY: `buf` is a valid and initialized pointer, and its correct length is passed - cerr(unsafe { libc::ttyname_r(self.as_raw_fd(), buf.as_mut_ptr() as _, buf.len()) })?; + cerr(unsafe { libc::ttyname_r(self.as_raw_fd(), buf.as_mut_ptr(), buf.len()) })?; // SAFETY: `buf` will have been initialized by the `ttyname_r` call, if it succeeded Ok(unsafe { os_string_from_ptr(buf.as_ptr()) }) } diff --git a/src/system/term/user_term.rs b/src/system/term/user_term.rs index 17058a20f..47355eecc 100644 --- a/src/system/term/user_term.rs +++ b/src/system/term/user_term.rs @@ -56,7 +56,7 @@ const LOCAL_FLAGS: tcflag_t = ISIG static GOT_SIGTTOU: AtomicBool = AtomicBool::new(false); -/// This is like `tcsetattr` but it only suceeds if we are in the foreground process group. +/// This is like `tcsetattr` but it only succeeds if we are in the foreground process group. /// # Safety /// /// The arguments to this function have to be valid arguments to `tcsetattr`. @@ -247,7 +247,7 @@ impl UserTerm { }; // Set terminal to raw mode. - // SAFETY: `term` is a valid, initialized pointer to struct of type `termios`, which + // SAFETY: `term` is a valid, initialized struct of type `termios`, which // was previously obtained through `tcgetattr`. unsafe { cfmakeraw(&mut term) }; // Enable terminal signals.