diff options
| author | mo8it <mo8it@proton.me> | 2024-08-01 01:07:31 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-08-01 01:07:31 +0200 |
| commit | 802b97b2edb142ad6bc4ee10ccc16ece7c6dc346 (patch) | |
| tree | d4510d0b4a40ca6467578542f07ae653f0680329 /src/cmd.rs | |
| parent | 2ad408f2b8eb357a3f2b44b7facb9e3bfe4f35a2 (diff) | |
Set stdin to null when running the binary of an exercise
Diffstat (limited to 'src/cmd.rs')
| -rw-r--r-- | src/cmd.rs | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -10,7 +10,8 @@ use std::{ pub fn run_cmd(mut cmd: Command, description: &str, output: Option<&mut Vec<u8>>) -> Result<bool> { let spawn = |mut cmd: Command| { // NOTE: The closure drops `cmd` which prevents a pipe deadlock. - cmd.spawn() + cmd.stdin(Stdio::null()) + .spawn() .with_context(|| format!("Failed to run the command `{description}`")) }; |
