summaryrefslogtreecommitdiff
path: root/missing/nt.c
diff options
context:
space:
mode:
Diffstat (limited to 'missing/nt.c')
-rw-r--r--missing/nt.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/missing/nt.c b/missing/nt.c
index 58736ae2419..b96ac933408 100644
--- a/missing/nt.c
+++ b/missing/nt.c
@@ -491,6 +491,20 @@ mypopen (char *cmd, char *mode)
sa.lpSecurityDescriptor = NULL;
sa.bInheritHandle = TRUE;
+ if (!reading) {
+ FILE *fp;
+
+ fp = (_popen)(cmd, mode);
+
+ MyPopenRecord[slot].inuse = TRUE;
+ MyPopenRecord[slot].pipe = fp;
+ MyPopenRecord[slot].pid = -1;
+
+ if (!fp)
+ Fatal("cannot open pipe \"%s\" (%s)", cmd, strerror(errno));
+ return fp;
+ }
+
fRet = CreatePipe(&hInFile, &hOutFile, &sa, 2048L);
if (!fRet)
Fatal("cannot open pipe \"%s\" (%s)", cmd, strerror(errno));