Skip to content

Commit

Permalink
Allow daemon client to clean up before exit
Browse files Browse the repository at this point in the history
Signed-off-by: Timothy Johnson <[email protected]>
  • Loading branch information
t1m0thyj committed Dec 24, 2024
1 parent 8487a88 commit 27ef793
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions zowex/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/

use std::env;
use std::io;
use std::process::ExitCode;

// other source modules that constitute this executable
mod comm;
Expand Down Expand Up @@ -38,7 +38,7 @@ extern crate tokio;
// 3.6393932 and 0.76156812 zowe average over 10 run sample = 2.87782508 sec faster on windows

#[tokio::main]
async fn main() -> io::Result<()> {
async fn main() -> ExitCode {
// turn args into vector
let mut cmd_line_args: Vec<String> = env::args().collect();

Expand All @@ -55,8 +55,6 @@ async fn main() -> io::Result<()> {
Err(err_val) => err_val,
};

/* Rust does not enable main() to return an exit code.
* Thus, we explicitly exit the process with our desired exit code.
*/
std::process::exit(exit_code);
// return exit code to indicate success or failure
ExitCode::from(exit_code as u8)
}

0 comments on commit 27ef793

Please sign in to comment.