Skip to content

Commit

Permalink
Tidy up imports in test_ptrace.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
marmistrz committed Jul 20, 2017
1 parent 3192df4 commit d5c4d0f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/sys/test_ptrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ use nix::Error;
use nix::errno::*;
use nix::unistd::*;
use nix::sys::ptrace;
use nix::sys::ptrace::*;
use nix::sys::ptrace::ptrace::*;

use std::{mem, ptr};

#[test]
fn test_ptrace() {
use nix::sys::ptrace::ptrace::*;
// Just make sure ptrace can be called at all, for now.
// FIXME: qemu-user doesn't implement ptrace on all arches, so permit ENOSYS
let err = ptrace(PTRACE_ATTACH, getpid(), ptr::null_mut(), ptr::null_mut()).unwrap_err();
let err = ptrace::ptrace(PTRACE_ATTACH, getpid(), ptr::null_mut(), ptr::null_mut()).unwrap_err();
assert!(err == Error::Sys(Errno::EPERM) || err == Error::Sys(Errno::ENOSYS));
}

// Just make sure ptrace_setoptions can be called at all, for now.
#[test]
fn test_ptrace_setoptions() {
use nix::sys::ptrace::ptrace::*; // for PTRACE_O_TRACESYSGOOD
let err = ptrace::setoptions(getpid(), PTRACE_O_TRACESYSGOOD).unwrap_err();
assert!(err != Error::UnsupportedOperation);
}
Expand Down

0 comments on commit d5c4d0f

Please sign in to comment.