Commit 97e7aac
fix: clear FD_CLOEXEC on stdio fds in spawn_inherited (#172)
libuv (used by Node.js) marks stdin/stdout/stderr as close-on-exec,
which causes them to be closed when the child process calls exec().
This resulted in the child's fds 0-2 being closed after exec, and
Node.js reopening them as /dev/null, silently discarding all output.
Add a pre_exec hook to spawn_inherited() that clears FD_CLOEXEC on
fds 0, 1, 2 before exec, matching the existing fix in vite-plus's
vite_command::fix_stdio_streams().
Ref: libuv/libuv#2062
---------
Co-authored-by: branchseer <3612422+branchseer@users.noreply.github.com>1 parent 261c567 commit 97e7aac
1 file changed
+34
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
382 | | - | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
383 | 416 | | |
384 | 417 | | |
385 | 418 | | |
| |||
0 commit comments