summaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/aio.rs8
-rw-r--r--src/sys/ptrace/bsd.rs16
-rw-r--r--src/sys/select.rs2
-rw-r--r--src/sys/socket/mod.rs2
4 files changed, 14 insertions, 14 deletions
diff --git a/src/sys/aio.rs b/src/sys/aio.rs
index 7868a294..a03caa45 100644
--- a/src/sys/aio.rs
+++ b/src/sys/aio.rs
@@ -513,7 +513,7 @@ impl<'a> AioCb<'a> {
}
}
- fn error_unpinned(self: &mut Self) -> Result<()> {
+ fn error_unpinned(&mut self) -> Result<()> {
let r = unsafe {
libc::aio_error(&mut self.aiocb.0 as *mut libc::aiocb)
};
@@ -645,7 +645,7 @@ impl<'a> AioCb<'a> {
SigEvent::from(&self.aiocb.0.aio_sigevent)
}
- fn aio_return_unpinned(self: &mut Self) -> Result<isize> {
+ fn aio_return_unpinned(&mut self) -> Result<isize> {
unsafe {
let p: *mut libc::aiocb = &mut self.aiocb.0;
self.in_progress = false;
@@ -838,6 +838,10 @@ unsafe impl<'a> Sync for LioCb<'a> {}
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
impl<'a> LioCb<'a> {
+ pub fn is_empty(&self) -> bool {
+ self.aiocbs.is_empty()
+ }
+
/// Return the number of individual [`AioCb`]s contained.
pub fn len(&self) -> usize {
self.aiocbs.len()
diff --git a/src/sys/ptrace/bsd.rs b/src/sys/ptrace/bsd.rs
index e85afc76..141dfbc4 100644
--- a/src/sys/ptrace/bsd.rs
+++ b/src/sys/ptrace/bsd.rs
@@ -133,16 +133,14 @@ pub fn kill(pid: Pid) -> Result<()> {
/// use nix::unistd::Pid;
/// use nix::sys::signal::Signal;
/// use nix::sys::wait::*;
-/// fn main() {
-/// // If a process changes state to the stopped state because of a SIGUSR1
-/// // signal, this will step the process forward and forward the user
-/// // signal to the stopped process
-/// match waitpid(Pid::from_raw(-1), None) {
-/// Ok(WaitStatus::Stopped(pid, Signal::SIGUSR1)) => {
-/// let _ = step(pid, Signal::SIGUSR1);
-/// }
-/// _ => {},
+/// // If a process changes state to the stopped state because of a SIGUSR1
+/// // signal, this will step the process forward and forward the user
+/// // signal to the stopped process
+/// match waitpid(Pid::from_raw(-1), None) {
+/// Ok(WaitStatus::Stopped(pid, Signal::SIGUSR1)) => {
+/// let _ = step(pid, Signal::SIGUSR1);
/// }
+/// _ => {},
/// }
/// ```
#[cfg(
diff --git a/src/sys/select.rs b/src/sys/select.rs
index 19ae2f1c..5eb64234 100644
--- a/src/sys/select.rs
+++ b/src/sys/select.rs
@@ -50,12 +50,10 @@ impl FdSet {
///
/// ```
/// # use nix::sys::select::FdSet;
- /// # fn main() {
/// let mut set = FdSet::new();
/// set.insert(4);
/// set.insert(9);
/// assert_eq!(set.highest(), Some(9));
- /// # }
/// ```
///
/// [`select`]: fn.select.html
diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs
index e4baeb5d..69070463 100644
--- a/src/sys/socket/mod.rs
+++ b/src/sys/socket/mod.rs
@@ -710,7 +710,7 @@ impl ControlMessageOwned {
},
(_, _) => {
let sl = slice::from_raw_parts(p, len);
- let ucmsg = UnknownCmsg(*header, Vec::<u8>::from(&sl[..]));
+ let ucmsg = UnknownCmsg(*header, Vec::<u8>::from(sl));
ControlMessageOwned::Unknown(ucmsg)
}
}