Merge pull request #322 from tmuehlbacher/fix-c-exit-code

Fix C exit code
This commit is contained in:
koverstreet 2024-07-30 17:56:43 -04:00 committed by GitHub
commit 1e5452a027
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View File

@ -195,7 +195,7 @@
flakeCheck = false;
programs = {
nixfmt-rfc-style.enable = true;
nixfmt.enable = true;
rustfmt.edition = rustfmtToml.edition;
rustfmt.enable = true;
rustfmt.package = fenix.packages.${system}.default.rustfmt;

View File

@ -9,6 +9,7 @@ use std::{
};
use bch_bindgen::c;
use log::debug;
#[derive(Debug)]
pub struct ErrnoError(pub errno::Errno);
@ -110,6 +111,11 @@ fn main() -> ExitCode {
"list" => commands::list(args[1..].to_vec()).report(),
"mount" => commands::mount(args, symlink_cmd).report(),
"subvolume" => commands::subvolume(args[1..].to_vec()).report(),
_ => ExitCode::from(u8::try_from(handle_c_command(args, symlink_cmd)).unwrap()),
_ => {
let r = handle_c_command(args, symlink_cmd);
debug!("return code from C command: {r}");
ExitCode::from(r as u8)
}
}
}