Switch to real standard, fix daemonization on real standard

This commit is contained in:
Jeremy Soller 2016-11-10 20:02:51 -07:00
parent da3f9558d9
commit 2db2d10cce
15 changed files with 55 additions and 45 deletions

View file

@ -7,7 +7,7 @@ use std::collections::{BTreeMap, VecDeque};
use std::fs::File;
use std::io::{Read, Write};
use std::rc::{Rc, Weak};
use std::{str, thread};
use std::str;
use syscall::data::Packet;
use syscall::error::{Error, Result, EBADF, EINVAL, ENOENT, EPIPE, EWOULDBLOCK};
@ -289,7 +289,8 @@ impl PtySlave {
}
fn main(){
thread::spawn(move || {
// Daemonize
if unsafe { syscall::clone(0).unwrap() } == 0 {
let mut socket = File::create(":pty").expect("pty: failed to create pty scheme");
let mut scheme = PtyScheme::new();
let mut todo = Vec::new();
@ -375,5 +376,5 @@ fn main(){
}
}
}
});
}
}