Skip to content

Commit

Permalink
(sat-bench.rs) handle an environment without hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
shnarazk committed Aug 11, 2024
1 parent b9777b1 commit b35f030
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/bin/sat-bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,16 @@ fn main() {
config.range_to = 250;
config.benchmark_set = true;
}
let host = Command::new("hostname")
.arg("-s")
.output()
.expect("failed to execute process")
.stdout;
let host = if let Ok(output) = Command::new("hostname").arg("-s").output() {
output.stdout
} else {
b"localhost".to_vec()
};
/* let host = Command::new("hostname")
.arg("-s")
.output()
.expect("failed to execute 'hostname'")
.stdout; */
let h = String::from_utf8_lossy(&host[..host.len() - 1]);
if config.solver_opts.is_empty() {
println!(
Expand Down

0 comments on commit b35f030

Please sign in to comment.