use prelude::v1::*;
use self::Req::*;
-use collections;
+use collections::HashMap;
+use collections::hash_map::Hasher;
use ffi::CString;
use hash::Hash;
use io::process::{ProcessExit, ExitStatus, ExitSignal};
out_fd: Option<P>, err_fd: Option<P>)
-> IoResult<Process>
where C: ProcessConfig<K, V>, P: AsInner<FileDesc>,
- K: BytesContainer + Eq + Hash, V: BytesContainer
+ K: BytesContainer + Eq + Hash<Hasher>, V: BytesContainer
{
use libc::funcs::posix88::unistd::{fork, dup2, close, chdir, execvp};
use libc::funcs::bsd44::getdtablesize;
return match input.read(&mut bytes) {
Ok(8) => {
assert!(combine(CLOEXEC_MSG_FOOTER) == combine(bytes.slice(4, 8)),
- "Validation on the CLOEXEC pipe failed: {}", bytes);
+ "Validation on the CLOEXEC pipe failed: {:?}", bytes);
let errno = combine(bytes.slice(0, 4));
assert!(p.wait(0).is_ok(), "wait(0) should either return Ok or panic");
Err(super::decode_error(errno))
Err(ref e) if e.kind == EndOfFile => Ok(p),
Err(e) => {
assert!(p.wait(0).is_ok(), "wait(0) should either return Ok or panic");
- panic!("the CLOEXEC pipe failed: {}", e)
+ panic!("the CLOEXEC pipe failed: {:?}", e)
},
Ok(..) => { // pipe I/O up to PIPE_BUF bytes should be atomic
assert!(p.wait(0).is_ok(), "wait(0) should either return Ok or panic");
fn setgroups(ngroups: libc::c_int,
ptr: *const libc::c_void) -> libc::c_int;
}
- let _ = setgroups(0, 0 as *const libc::c_void);
+ let _ = setgroups(0, ptr::null());
if libc::setuid(u as libc::uid_t) != 0 {
fail(&mut output);
let mut status = 0 as c_int;
if deadline == 0 {
return match retry(|| unsafe { c::waitpid(self.pid, &mut status, 0) }) {
- -1 => panic!("unknown waitpid error: {}", super::last_error()),
+ -1 => panic!("unknown waitpid error: {:?}", super::last_error()),
_ => Ok(translate_status(status)),
}
}
continue
}
- n => panic!("error in select {} ({})", os::errno(), n),
+ n => panic!("error in select {:?} ({:?})", os::errno(), n),
}
// Process any pending messages
n if n > 0 => { ret = true; }
0 => return true,
-1 if wouldblock() => return ret,
- n => panic!("bad read {} ({})", os::last_os_error(), n),
+ n => panic!("bad read {:?} ({:?})", os::last_os_error(), n),
}
}
}
} {
1 => {}
-1 if wouldblock() => {} // see above comments
- n => panic!("bad error on write fd: {} {}", n, os::errno()),
+ n => panic!("bad error on write fd: {:?} {:?}", n, os::errno()),
}
}
}
}) {
n if n == self.pid => Some(translate_status(status)),
0 => None,
- n => panic!("unknown waitpid error `{}`: {}", n,
+ n => panic!("unknown waitpid error `{:?}`: {:?}", n,
super::last_error()),
}
}
cb(ptrs.as_ptr())
}
-fn with_envp<K,V,T,F>(env: Option<&collections::HashMap<K, V>>,
+fn with_envp<K,V,T,F>(env: Option<&HashMap<K, V>>,
cb: F)
-> T
where F : FnOnce(*const c_void) -> T,
- K : BytesContainer + Eq + Hash,
+ K : BytesContainer + Eq + Hash<Hasher>,
V : BytesContainer
{
// On posixy systems we can pass a char** for envp, which is a