diff --git a/Cargo.lock b/Cargo.lock index 95be678..4958b2f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -116,7 +116,7 @@ dependencies = [ [[package]] name = "nsexec" -version = "0.1.3" +version = "0.1.4" dependencies = [ "libc", "nix", diff --git a/Cargo.toml b/Cargo.toml index dc21328..05143bf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nsexec" -version = "0.1.3" +version = "0.1.4" authors = ["Yang Keao "] edition = "2018" diff --git a/src/main.rs b/src/main.rs index 17a5be1..206627b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -87,7 +87,11 @@ fn main() { command }; - + let mut child = command.spawn().unwrap(); - child.wait().unwrap(); + let status = child.wait().unwrap(); + + if let Some(code) = status.code() { + std::process::exit(code) + } }