Commit 2fff3d6
committed
libct: check cmd.Err after exec.Command call
Theoretically, exec.Command can set cmd.Err.
Practically, this should never happen (Linux, Go <= 1.26, exePath is
absolute), but in the unlikely case it does, let's fail early.
This is related to the recently introduced cloneCmd which chooses to not
copy the Err field. Theoretically, exec.Command can set Err and so the
first call to cmd.Start will fail (since Err != nil), and the second
call to cmd.Start may succeed because Err == nil. Yet, this scenario is
highly unlikely, but better be safe than sorry.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>1 parent 73d7d7d commit 2fff3d6
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
531 | 537 | | |
532 | 538 | | |
533 | 539 | | |
| |||
0 commit comments