summaryrefslogtreecommitdiff
path: root/test/fixtures/spawn_closed_stdio.py
diff options
context:
space:
mode:
authorBartosz Sosnowski <bartosz@janeasystems.com>2017-03-14 18:22:53 +0100
committerAnna Henningsen <anna@addaleax.net>2017-03-20 20:48:14 +0100
commitbd496e0187cebe5ae2d5ea2888487f041e6970fb (patch)
treeec0953523af84657d47b20c5271f37cd5caedb6c /test/fixtures/spawn_closed_stdio.py
parent3622a97715858dc7e6aead57b605189c9cad0337 (diff)
downloadandroid-node-v8-bd496e0187cebe5ae2d5ea2888487f041e6970fb.tar.gz
android-node-v8-bd496e0187cebe5ae2d5ea2888487f041e6970fb.tar.bz2
android-node-v8-bd496e0187cebe5ae2d5ea2888487f041e6970fb.zip
src: ensure that fd 0-2 are valid on windows
Check that stdin, stdout and stderr are valid file descriptors on Windows. If not, reopen them with 'nul' file. Refs: https://github.com/nodejs/node/pull/875 Fixes: https://github.com/nodejs/node/issues/11656 PR-URL: https://github.com/nodejs/node/pull/11863 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'test/fixtures/spawn_closed_stdio.py')
-rw-r--r--test/fixtures/spawn_closed_stdio.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/fixtures/spawn_closed_stdio.py b/test/fixtures/spawn_closed_stdio.py
new file mode 100644
index 0000000000..b5de2552c2
--- /dev/null
+++ b/test/fixtures/spawn_closed_stdio.py
@@ -0,0 +1,8 @@
+import os
+import sys
+import subprocess
+os.close(0)
+os.close(1)
+os.close(2)
+exit_code = subprocess.call(sys.argv[1:], shell=False)
+sys.exit(exit_code)