summaryrefslogtreecommitdiff
path: root/src/sys/signal.rs
diff options
context:
space:
mode:
authorAlan Somers <asomers@gmail.com>2020-05-31 15:17:16 -0600
committerAlan Somers <asomers@gmail.com>2020-05-31 19:07:15 -0600
commit1ae5dd8b16aed61958fd3ce488ed7fd459743652 (patch)
tree17c28555c9b2cd3db3741dcd28b7401d08ad3678 /src/sys/signal.rs
parent84e66d7a29234d16d62c5fa5bc5b66ad5504c2a2 (diff)
downloadnix-1ae5dd8b16aed61958fd3ce488ed7fd459743652.zip
Convert the crate to edition 2018
Diffstat (limited to 'src/sys/signal.rs')
-rw-r--r--src/sys/signal.rs14
1 files changed, 5 insertions, 9 deletions
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<SigActi
///
/// ```no_run
/// # #[macro_use] extern crate lazy_static;
-/// # extern crate libc;
-/// # extern crate nix;
/// # use std::convert::TryFrom;
/// # use std::sync::atomic::{AtomicBool, Ordering};
/// # use nix::sys::signal::{self, Signal, SigHandler};
@@ -735,7 +733,7 @@ pub fn sigprocmask(how: SigmaskHow, set: Option<&SigSet>, oldset: Option<&mut Si
Errno::result(res).map(drop)
}
-pub fn kill<T: Into<Option<Signal>>>(pid: ::unistd::Pid, signal: T) -> Result<()> {
+pub fn kill<T: Into<Option<Signal>>>(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<T: Into<Option<Signal>>>(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<T: Into<Option<Signal>>>(pgrp: ::unistd::Pid, signal: T) -> Result<()> {
+pub fn killpg<T: Into<Option<Signal>>>(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,