Correctly exit when parent, not child

This commit is contained in:
Jeremy Soller
2017-07-20 20:37:40 -06:00
parent ad00ba9eae
commit 4e2561ed75
+2 -2
View File
@@ -105,7 +105,7 @@ pub fn main() {
if parser.args.len() < 1 {
fail("getty: no TTY provided", &mut stderr);
}
let tty = &parser.args[0];
if let Err(err) = set_tty(&tty) {
fail(&format!("getty: failed to open TTY {}: {}", tty, err), &mut stderr);
@@ -128,7 +128,7 @@ pub fn main() {
match unsafe { syscall::clone(0) } {
Ok(0) => daemon(clear, &mut stderr),
Ok(_) => fail("getty: failed to fork login", &mut stderr),
Ok(_) => (),
Err(err) => fail(&format!("getty: failed to fork login: {}", err), &mut stderr)
}
}