Skip to content

Commit

Permalink
Fix mismerge
Browse files Browse the repository at this point in the history
  • Loading branch information
asomers committed Jul 11, 2019
1 parent a6a2221 commit 6466989
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/sched.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ mod sched_linux_like {
let ptr_aligned = ptr.offset((ptr as usize % 16) as isize * -1);
libc::clone(
mem::transmute(
callback as extern "C" fn(*mut Box<::std::ops::FnMut() -> isize>) -> i32,
callback as extern "C" fn(*mut Box<dyn FnMut() -> isize>) -> i32,
),
ptr_aligned as *mut c_void,
combined,
Expand All @@ -124,26 +124,11 @@ mod sched_linux_like {
Errno::result(res).map(Pid::from_raw)
}

<<<<<<< HEAD
pub fn unshare(flags: CloneFlags) -> Result<()> {
let res = unsafe { libc::unshare(flags.bits()) };

Errno::result(res).map(drop)
}
=======
let res = unsafe {
let combined = flags.bits() | signal.unwrap_or(0);
let ptr = stack.as_mut_ptr().offset(stack.len() as isize);
let ptr_aligned = ptr.offset((ptr as usize % 16) as isize * -1);
libc::clone(mem::transmute(callback as extern "C" fn(*mut Box<dyn FnMut() -> isize>) -> i32),
ptr_aligned as *mut c_void,
combined,
&mut cb as *mut _ as *mut c_void)
};

Errno::result(res).map(Pid::from_raw)
}
>>>>>>> Fix warnings on Rust 1.37.0

pub fn setns(fd: RawFd, nstype: CloneFlags) -> Result<()> {
let res = unsafe { libc::setns(fd, nstype.bits()) };
Expand Down

0 comments on commit 6466989

Please sign in to comment.