From 1ae5dd8b16aed61958fd3ce488ed7fd459743652 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Sun, 31 May 2020 15:17:16 -0600 Subject: Convert the crate to edition 2018 --- src/sys/signal.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/sys/signal.rs') diff --git a/src/sys/signal.rs b/src/sys/signal.rs index 2b36c957..710e65f5 100644 --- a/src/sys/signal.rs +++ b/src/sys/signal.rs @@ -3,9 +3,9 @@ ///! Operating system signals. -use libc; -use {Error, Result}; -use errno::Errno; +use crate::{Error, Result}; +use crate::errno::Errno; +use crate::unistd::Pid; use std::convert::TryFrom; use std::mem; use std::fmt; @@ -623,8 +623,6 @@ pub unsafe fn sigaction(signal: Signal, sigaction: &SigAction) -> Result, oldset: Option<&mut Si Errno::result(res).map(drop) } -pub fn kill>>(pid: ::unistd::Pid, signal: T) -> Result<()> { +pub fn kill>>(pid: Pid, signal: T) -> Result<()> { let res = unsafe { libc::kill(pid.into(), match signal.into() { Some(s) => s as libc::c_int, @@ -751,7 +749,7 @@ pub fn kill>>(pid: ::unistd::Pid, signal: T) -> Result<() /// If `pgrp` less then or equal 1, the behavior is platform-specific. /// If `signal` is `None`, `killpg` will only preform error checking and won't /// send any signal. -pub fn killpg>>(pgrp: ::unistd::Pid, signal: T) -> Result<()> { +pub fn killpg>>(pgrp: Pid, signal: T) -> Result<()> { let res = unsafe { libc::killpg(pgrp.into(), match signal.into() { Some(s) => s as libc::c_int, @@ -802,7 +800,6 @@ pub enum SigevNotify { #[cfg(not(any(target_os = "openbsd", target_os = "redox")))] mod sigevent { - use libc; use std::mem; use std::ptr; use super::SigevNotify; @@ -1019,7 +1016,6 @@ mod tests { #[test] #[cfg(not(target_os = "redox"))] fn test_sigaction() { - use libc; thread::spawn(|| { extern fn test_sigaction_handler(_: libc::c_int) {} extern fn test_sigaction_action(_: libc::c_int, -- cgit v1.2.3