Skip to content

Commit

Permalink
Fix test header and imports
Browse files Browse the repository at this point in the history
  • Loading branch information
voidc committed Mar 16, 2021
1 parent d850f6b commit 5ac8a31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions library/std/src/sys/unix/process/process_unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ use crate::fmt;
use crate::io::{self, Error, ErrorKind};
use crate::mem;
use crate::ptr;
use crate::sync::atomic::{AtomicBool, Ordering};
use crate::sys;
use crate::sys::cvt;
use crate::sys::process::process_common::*;
use crate::sys_common::FromInner;

#[cfg(target_os = "linux")]
use crate::os::linux::process::PidFd;
Expand All @@ -16,7 +14,7 @@ use crate::os::linux::process::PidFd;
use libc::RTP_ID as pid_t;

#[cfg(not(target_os = "vxworks"))]
use libc::{c_int, c_long, gid_t, pid_t, uid_t};
use libc::{c_int, gid_t, pid_t, uid_t};

////////////////////////////////////////////////////////////////////////////////
// Command
Expand Down Expand Up @@ -132,6 +130,7 @@ impl Command {
// If this fails, we will fall through this block to a call to `fork()`
#[cfg(target_os = "linux")]
{
use crate::sync::atomic::{AtomicBool, Ordering};
static HAS_CLONE3: AtomicBool = AtomicBool::new(true);

const CLONE_PIDFD: u64 = 0x00001000;
Expand All @@ -152,7 +151,7 @@ impl Command {
}

syscall! {
fn clone3(cl_args: *mut clone_args, len: libc::size_t) -> c_long
fn clone3(cl_args: *mut clone_args, len: libc::size_t) -> libc::c_long
}

if HAS_CLONE3.load(Ordering::Relaxed) {
Expand Down Expand Up @@ -529,6 +528,7 @@ pub struct Process {
impl Process {
#[cfg(target_os = "linux")]
fn new(pid: pid_t, pidfd: pid_t) -> Self {
use crate::sys_common::FromInner;
let pidfd = (pidfd >= 0).then(|| PidFd::from_inner(sys::fd::FileDesc::new(pidfd)));
Process { pid, status: None, pidfd }
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/command/command-create-pidfd.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-pass
// linux-only - pidfds are a linux-specific concept
// only-linux - pidfds are a linux-specific concept

#![feature(linux_pidfd)]
use std::os::linux::process::{CommandExt, ChildExt};
Expand Down

0 comments on commit 5ac8a31

Please sign in to comment.