Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
danog authored and xtrime-ru committed May 7, 2024
1 parent 75cae4b commit ccfdc59
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ fn sample_pyroscope(pid: remoteprocess::Pid, config: &Config) -> Result<(), Erro
short_filename: None,
line: 0,
locals: None,
is_entry: true
});
}

Expand Down Expand Up @@ -619,7 +620,7 @@ fn pyspy_main() -> Result<(), Error> {

let mut command = command.args(&subprocess[1..]);

if config.capture_output {
if !config.capture_output {
command = command
.stdin(std::process::Stdio::null())
.stdout(process_output.reopen()?)
Expand Down Expand Up @@ -656,7 +657,7 @@ fn pyspy_main() -> Result<(), Error> {

// if we failed for any reason, dump out stderr from child process here
// (could have useful error message)
if config.capture_output && (!success || result.is_err()) {
if !config.capture_output && (!success || result.is_err()) {
let mut buffer = String::new();
if process_output.read_to_string(&mut buffer).is_ok() {
eprintln!("{}", buffer);
Expand Down

0 comments on commit ccfdc59

Please sign in to comment.