Skip to content

Commit

Permalink
pass return value
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
  • Loading branch information
YangKeao committed Dec 8, 2020
1 parent 5dd5f6c commit b9d8356
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nsexec"
version = "0.1.3"
version = "0.1.4"
authors = ["Yang Keao <keao.yang@yahoo.com>"]
edition = "2018"

Expand Down
8 changes: 6 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit b9d8356

Please sign in to comment.