| ... | @@ -428,12 +428,15 @@ pub fn run(args: struct { | ... | @@ -428,12 +428,15 @@ pub fn run(args: struct { |
| 428 | } | 428 | } |
| 429 | | 429 | |
| 430 | try child.spawn(); | 430 | try child.spawn(); |
| | 431 | errdefer { |
| | 432 | _ = child.kill() catch {}; |
| | 433 | } |
| 431 | try child.collectOutput(&stdout, &stderr, args.max_output_bytes); | 434 | try child.collectOutput(&stdout, &stderr, args.max_output_bytes); |
| 432 | | 435 | |
| 433 | return RunResult{ | 436 | return RunResult{ |
| 434 | .term = try child.wait(), | | |
| 435 | .stdout = try stdout.toOwnedSlice(), | 437 | .stdout = try stdout.toOwnedSlice(), |
| 436 | .stderr = try stderr.toOwnedSlice(), | 438 | .stderr = try stderr.toOwnedSlice(), |
| | 439 | .term = try child.wait(), |
| 437 | }; | 440 | }; |
| 438 | } | 441 | } |
| 439 | | 442 | |