Skip to content

Commit

Permalink
Simplify spawning daemon
Browse files Browse the repository at this point in the history
  • Loading branch information
schneems committed Sep 11, 2023
1 parent abcf16d commit daa1074
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion buildpacks/ruby/src/bin/agentmon_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ where

eprintln!("Running: {}", commons::fun_run::display(&mut cmd));

cmd.spawn().and_then(|mut child| child.wait())
cmd.status()
}

#[derive(Debug, thiserror::Error, PartialEq)]
Expand Down
17 changes: 7 additions & 10 deletions buildpacks/ruby/src/bin/launch_daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,11 @@ fn main() {
&agentmon.to_string_lossy(),
]);

command
.spawn()
.and_then(|mut child| child.wait())
.unwrap_or_else(|error| {
eprintln!(
"Command failed {}. Details: {error}",
commons::fun_run::display(&mut command)
);
exit(1)
});
command.status().unwrap_or_else(|error| {
eprintln!(
"Command failed {}. Details: {error}",
commons::fun_run::display(&mut command)
);
exit(1)
});
}

0 comments on commit daa1074

Please sign in to comment.