From 57f41a8898e80f220d231136e26193db77388c03 Mon Sep 17 00:00:00 2001 From: Ryan Zoeller Date: Sun, 26 Dec 2021 20:14:50 -0600 Subject: [PATCH] Fix typos --- src/poll.rs | 4 ++-- src/pty.rs | 4 ++-- src/sys/signal.rs | 2 +- src/sys/statfs.rs | 4 ++-- src/time.rs | 2 +- src/unistd.rs | 6 +++--- test/sys/test_ptrace.rs | 2 +- test/sys/test_sockopt.rs | 2 +- test/test_mount.rs | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/poll.rs b/src/poll.rs index 5b1815264d..6d332b0350 100644 --- a/src/poll.rs +++ b/src/poll.rs @@ -10,7 +10,7 @@ use crate::errno::Errno; /// [`ppoll`](fn.ppoll.html) functions to specify the events of interest /// for a specific file descriptor. /// -/// After a call to `poll` or `ppoll`, the events that occured can be +/// After a call to `poll` or `ppoll`, the events that occurred can be /// retrieved by calling [`revents()`](#method.revents) on the `PollFd`. #[repr(transparent)] #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] @@ -31,7 +31,7 @@ impl PollFd { } } - /// Returns the events that occured in the last call to `poll` or `ppoll`. Will only return + /// Returns the events that occurred in the last call to `poll` or `ppoll`. Will only return /// `None` if the kernel provides status flags that Nix does not know about. pub fn revents(self) -> Option { PollFlags::from_bits(self.pollfd.revents) diff --git a/src/pty.rs b/src/pty.rs index a104a69c90..ae304d83d3 100644 --- a/src/pty.rs +++ b/src/pty.rs @@ -112,7 +112,7 @@ pub fn grantpt(fd: &PtyMaster) -> Result<()> { /// Open a pseudoterminal device (see /// [`posix_openpt(3)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_openpt.html)) /// -/// `posix_openpt()` returns a file descriptor to an existing unused pseuterminal master device. +/// `posix_openpt()` returns a file descriptor to an existing unused pseudoterminal master device. /// /// # Examples /// @@ -214,7 +214,7 @@ pub fn ptsname_r(fd: &PtyMaster) -> Result { /// /// `unlockpt()` unlocks the slave pseudoterminal device corresponding to the master pseudoterminal /// referred to by `fd`. This must be called before trying to open the slave side of a -/// pseuoterminal. +/// pseudoterminal. #[inline] pub fn unlockpt(fd: &PtyMaster) -> Result<()> { if unsafe { libc::unlockpt(fd.as_raw_fd()) } < 0 { diff --git a/src/sys/signal.rs b/src/sys/signal.rs index f85bf26611..b655604dd4 100644 --- a/src/sys/signal.rs +++ b/src/sys/signal.rs @@ -866,7 +866,7 @@ pub fn pthread_sigmask(how: SigmaskHow, /// Examine and change blocked signals. /// -/// For more informations see the [`sigprocmask` man +/// For more information see the [`sigprocmask` man /// pages](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigprocmask.html). pub fn sigprocmask(how: SigmaskHow, set: Option<&SigSet>, oldset: Option<&mut SigSet>) -> Result<()> { if set.is_none() && oldset.is_none() { diff --git a/src/sys/statfs.rs b/src/sys/statfs.rs index bfb94f4866..622734753a 100644 --- a/src/sys/statfs.rs +++ b/src/sys/statfs.rs @@ -536,7 +536,7 @@ impl Debug for Statfs { /// Describes a mounted file system. /// -/// The result is OS-dependent. For a portabable alternative, see +/// The result is OS-dependent. For a portable alternative, see /// [`statvfs`](crate::sys::statvfs::statvfs). /// /// # Arguments @@ -552,7 +552,7 @@ pub fn statfs(path: &P) -> Result { /// Describes a mounted file system. /// -/// The result is OS-dependent. For a portabable alternative, see +/// The result is OS-dependent. For a portable alternative, see /// [`fstatvfs`](crate::sys::statvfs::fstatvfs). /// /// # Arguments diff --git a/src/time.rs b/src/time.rs index 959769f41e..01a8fd0024 100644 --- a/src/time.rs +++ b/src/time.rs @@ -14,7 +14,7 @@ use std::mem::MaybeUninit; /// Clock identifier /// -/// Newtype pattern around `clockid_t` (which is just alias). It pervents bugs caused by +/// Newtype pattern around `clockid_t` (which is just alias). It prevents bugs caused by /// accidentally passing wrong value. #[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)] pub struct ClockId(clockid_t); diff --git a/src/unistd.rs b/src/unistd.rs index 01f35215a4..7aa1cffe39 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -204,8 +204,8 @@ impl ForkResult { /// Create a new child process duplicating the parent process ([see /// fork(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fork.html)). /// -/// After calling the fork system call (successfully) two processes will -/// be created that are identical with the exception of their pid and the +/// After successfully calling the fork system call, a second process will +/// be created which is identical to the original except for the pid and the /// return value of this function. As an example: /// /// ``` @@ -225,7 +225,7 @@ impl ForkResult { /// } /// ``` /// -/// This will print something like the following (order indeterministic). The +/// This will print something like the following (order nondeterministic). The /// thing to note is that you end up with two processes continuing execution /// immediately after the fork call but with different match arms. /// diff --git a/test/sys/test_ptrace.rs b/test/sys/test_ptrace.rs index 83fff9a5b4..89c4e2ddad 100644 --- a/test/sys/test_ptrace.rs +++ b/test/sys/test_ptrace.rs @@ -72,7 +72,7 @@ fn test_ptrace_cont() { let _m = crate::FORK_MTX.lock(); // FIXME: qemu-user doesn't implement ptrace on all architectures - // and retunrs ENOSYS in this case. + // and returns ENOSYS in this case. // We (ab)use this behavior to detect the affected platforms // and skip the test then. // On valid platforms the ptrace call should return Errno::EPERM, this diff --git a/test/sys/test_sockopt.rs b/test/sys/test_sockopt.rs index 01920fd40a..59b97c8b7a 100644 --- a/test/sys/test_sockopt.rs +++ b/test/sys/test_sockopt.rs @@ -122,7 +122,7 @@ fn test_so_tcp_maxseg() { } // The CI doesn't supported getsockopt and setsockopt on emulated processors. -// It's beleived that a QEMU issue, the tests run ok on a fully emulated system. +// It's believed that a QEMU issue, the tests run ok on a fully emulated system. // Current CI just run the binary with QEMU but the Kernel remains the same as the host. // So the syscall doesn't work properly unless the kernel is also emulated. #[test] diff --git a/test/test_mount.rs b/test/test_mount.rs index 44287f975f..1ddfcfe932 100644 --- a/test/test_mount.rs +++ b/test/test_mount.rs @@ -1,6 +1,6 @@ mod common; -// Impelmentation note: to allow unprivileged users to run it, this test makes +// Implementation note: to allow unprivileged users to run it, this test makes // use of user and mount namespaces. On systems that allow unprivileged user // namespaces (Linux >= 3.8 compiled with CONFIG_USER_NS), the test should run // without root.