Commit 8cf8b607 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Fix compilation on Redox

parent fa05c153
[root]
name = "redox-ssh"
version = "0.1.0"
dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"num-bigint 0.1.39 (git+https://github.com/rust-num/num)",
"rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)",
"rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "byteorder"
version = "1.1.0"
......@@ -72,6 +59,19 @@ dependencies = [
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "redox-ssh"
version = "0.1.0"
dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"num-bigint 0.1.39 (git+https://github.com/rust-num/num)",
"rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)",
"rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "redox_syscall"
version = "0.1.26"
......
......@@ -86,10 +86,17 @@ impl Channel {
);
self.read_thread = Some(thread::spawn(move || {
#[cfg(target_os = "redox")]
use syscall::dup;
#[cfg(target_os = "redox")]
let master2 = unsafe { dup(master_fd, &[]).unwrap_or(!0) };
#[cfg(not(target_os = "redox"))]
use libc::dup;
#[cfg(not(target_os = "redox"))]
let master2 = unsafe { dup(master_fd) };
println!("dup result: {}", dup as u32);
println!("dup result: {}", master2 as u32);
let mut master = unsafe { File::from_raw_fd(master2) };
loop {
use std::str::from_utf8_unchecked;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment