commit 7f820b9f5375d42ba9882124c34606070da99310
parent 114b214d16e60b040046f636049a6050e08fddfe
Author: Rob Wu <rob@robwu.nl>
Date: Mon, 13 Oct 2025 12:13:48 +0000
Bug 1993128 - Don't close InputPipe from maybeClose while IO is pending r=gstoll
Differential Revision: https://phabricator.services.mozilla.com/D267886
Diffstat:
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/toolkit/modules/subprocess/subprocess_win.worker.js b/toolkit/modules/subprocess/subprocess_win.worker.js
@@ -220,7 +220,7 @@ class InputPipe extends Pipe {
false
);
- if (!ok) {
+ if (!ok && ctypes.winLastError !== win32.ERROR_IO_INCOMPLETE) {
this.onError();
}
}
diff --git a/toolkit/modules/subprocess/test/xpcshell/test_subprocess_child.js b/toolkit/modules/subprocess/test/xpcshell/test_subprocess_child.js
@@ -154,9 +154,7 @@ async function do_test_spawn_parent_with_child(isBreakAwayJob) {
await stdoutDonePromise;
- // On Windows, we close the pipes as soon as the parent process was detected
- // to have exited. This prevents the child's write to be read.
- if (wasChildAlive && AppConstants.platform !== "win") {
+ if (wasChildAlive) {
equal(stdoutText, EXPECTED_STDOUT_AT_CHILD_EXIT, "Stdout from child");
} else {
equal(stdoutText, "", "No more stdout after parent exited (with child)");