Skip to content

Commit

Permalink
Merge pull request #322 from tmuehlbacher/fix-c-exit-code
Browse files Browse the repository at this point in the history
Fix C exit code
  • Loading branch information
koverstreet authored Jul 30, 2024
2 parents 57cd58d + fb6a56b commit 1e5452a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 7 additions & 1 deletion src/bcachefs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use std::{
};

use bch_bindgen::c;
use log::debug;

#[derive(Debug)]
pub struct ErrnoError(pub errno::Errno);
Expand Down Expand Up @@ -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)
}
}
}

0 comments on commit 1e5452a

Please sign in to comment.