Skip to content

Commit 0e0b5da

Browse files
committed
Exit with ExitCode instead of syscall
Signed-off-by: Andrew Gunnerson <[email protected]>
1 parent 63782b6 commit 0e0b5da

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use std::{
99
io::{self, IsTerminal},
1010
net::{SocketAddr, ToSocketAddrs},
1111
path::PathBuf,
12+
process::ExitCode,
1213
str::FromStr,
1314
sync::atomic::{AtomicBool, Ordering},
1415
};
@@ -217,16 +218,16 @@ fn main_wrapper() -> Result<()> {
217218
last_error.map_or(Ok(()), Err)
218219
}
219220

220-
fn main() {
221+
fn main() -> ExitCode {
221222
match main_wrapper() {
222-
Ok(_) => {}
223+
Ok(_) => ExitCode::SUCCESS,
223224
Err(e) => {
224225
if LOGGING_INITIALIZED.load(Ordering::SeqCst) {
225226
error!("{e}");
226227
} else {
227228
eprintln!("{e}");
228229
}
229-
std::process::exit(1);
230+
ExitCode::FAILURE
230231
}
231232
}
232233
}

0 commit comments

Comments
 (0)