From c9be17adbacc1271e6c1ae19ad01074c717b72e5 Mon Sep 17 00:00:00 2001 From: Markus Pettersson Date: Fri, 30 Aug 2024 14:57:13 +0200 Subject: [PATCH] Print stderr if spawned subcommand fails Fix bug where stdout was printed instead of stderr if a spawned subcommand failed. --- wireguard-go-rs/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wireguard-go-rs/build.rs b/wireguard-go-rs/build.rs index 29759417e941..da981770d0bf 100644 --- a/wireguard-go-rs/build.rs +++ b/wireguard-go-rs/build.rs @@ -285,7 +285,7 @@ fn exec(mut command: impl BorrowMut) -> anyhow::Result { let stdout = str::from_utf8(&output.stdout).unwrap_or("Invalid UTF-8"); if !output.status.success() { - let stderr = str::from_utf8(&output.stdout).unwrap_or("Invalid UTF-8"); + let stderr = str::from_utf8(&output.stderr).unwrap_or("Invalid UTF-8"); eprintln!("Error from {command:?}"); eprintln!();