[Python-checkins] CVS: python/dist/src/Modules posixmodule.c,2.147,2.148
Fredrik Lundh
python-dev@python.org
Sun, 9 Jul 2000 16:35:27 -0700
Update of /cvsroot/python/python/dist/src/Modules
In directory slayer.i.sourceforge.net:/tmp/cvs-serv840/Modules
Modified Files:
posixmodule.c
Log Message:
- changed the nt.popen2 return values back to
(write, read, ...), based on feedback from GvR.
- added tuple-swapping code to popen2.py
- fixed some runaway indentation in posixmodule.c
Index: posixmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v
retrieving revision 2.147
retrieving revision 2.148
diff -C2 -r2.147 -r2.148
*** posixmodule.c 2000/07/09 17:59:32 2.147
--- posixmodule.c 2000/07/09 23:35:24 2.148
***************
*** 2296,2302 ****
static int
_PyPopenCreateProcess(char *cmdstring,
! HANDLE hStdin,
! HANDLE hStdout,
! HANDLE hStderr)
{
PROCESS_INFORMATION piProcInfo;
--- 2296,2302 ----
static int
_PyPopenCreateProcess(char *cmdstring,
! HANDLE hStdin,
! HANDLE hStdout,
! HANDLE hStderr)
{
PROCESS_INFORMATION piProcInfo;
***************
*** 2361,2373 ****
if (CreateProcess(NULL,
! s2,
! NULL,
! NULL,
! TRUE,
! CREATE_NEW_CONSOLE,
! NULL,
! NULL,
! &siStartInfo,
! &piProcInfo) ) {
/* Close the handles now so anyone waiting is woken. */
CloseHandle(piProcInfo.hProcess);
--- 2361,2373 ----
if (CreateProcess(NULL,
! s2,
! NULL,
! NULL,
! TRUE,
! CREATE_NEW_CONSOLE,
! NULL,
! NULL,
! &siStartInfo,
! &piProcInfo) ) {
/* Close the handles now so anyone waiting is woken. */
CloseHandle(piProcInfo.hProcess);
***************
*** 2405,2411 ****
* being created. */
fSuccess = DuplicateHandle(GetCurrentProcess(), hChildStdinWr,
! GetCurrentProcess(), &hChildStdinWrDup, 0,
! FALSE,
! DUPLICATE_SAME_ACCESS);
if (!fSuccess)
return win32_error("DuplicateHandle", NULL);
--- 2405,2411 ----
* being created. */
fSuccess = DuplicateHandle(GetCurrentProcess(), hChildStdinWr,
! GetCurrentProcess(), &hChildStdinWrDup, 0,
! FALSE,
! DUPLICATE_SAME_ACCESS);
if (!fSuccess)
return win32_error("DuplicateHandle", NULL);
***************
*** 2419,2425 ****
fSuccess = DuplicateHandle(GetCurrentProcess(), hChildStdoutRd,
! GetCurrentProcess(), &hChildStdoutRdDup, 0,
! FALSE,
! DUPLICATE_SAME_ACCESS);
if (!fSuccess)
return win32_error("DuplicateHandle", NULL);
--- 2419,2424 ----
fSuccess = DuplicateHandle(GetCurrentProcess(), hChildStdoutRd,
! GetCurrentProcess(), &hChildStdoutRdDup, 0,
! FALSE, DUPLICATE_SAME_ACCESS);
if (!fSuccess)
return win32_error("DuplicateHandle", NULL);
***************
*** 2432,2439 ****
if (!CreatePipe(&hChildStderrRd, &hChildStderrWr, &saAttr, 0))
return win32_error("CreatePipe", NULL);
! fSuccess = DuplicateHandle(GetCurrentProcess(), hChildStderrRd,
! GetCurrentProcess(), &hChildStderrRdDup, 0,
! FALSE,
! DUPLICATE_SAME_ACCESS);
if (!fSuccess)
return win32_error("DuplicateHandle", NULL);
--- 2431,2439 ----
if (!CreatePipe(&hChildStderrRd, &hChildStderrWr, &saAttr, 0))
return win32_error("CreatePipe", NULL);
! fSuccess = DuplicateHandle(GetCurrentProcess(),
! hChildStderrRd,
! GetCurrentProcess(),
! &hChildStderrRdDup, 0,
! FALSE, DUPLICATE_SAME_ACCESS);
if (!fSuccess)
return win32_error("DuplicateHandle", NULL);
***************
*** 2517,2521 ****
CloseHandle(hChildStderrRdDup);
! f = Py_BuildValue("OO",p2,p1);
break;
}
--- 2517,2521 ----
CloseHandle(hChildStderrRdDup);
! f = Py_BuildValue("OO",p1,p2);
break;
}
***************
*** 2546,2550 ****
PyFile_SetBufSize(p2, 0);
PyFile_SetBufSize(p3, 0);
! f = Py_BuildValue("OOO",p2,p1,p3);
break;
}
--- 2546,2550 ----
PyFile_SetBufSize(p2, 0);
PyFile_SetBufSize(p3, 0);
! f = Py_BuildValue("OOO",p1,p2,p3);
break;
}
***************
*** 2553,2566 ****
if (n == POPEN_4) {
if (!_PyPopenCreateProcess(cmdstring,
! hChildStdinRd,
! hChildStdoutWr,
! hChildStdoutWr))
return win32_error("CreateProcess", NULL);
}
else {
if (!_PyPopenCreateProcess(cmdstring,
! hChildStdinRd,
! hChildStdoutWr,
! hChildStderrWr))
return win32_error("CreateProcess", NULL);
}
--- 2553,2566 ----
if (n == POPEN_4) {
if (!_PyPopenCreateProcess(cmdstring,
! hChildStdinRd,
! hChildStdoutWr,
! hChildStdoutWr))
return win32_error("CreateProcess", NULL);
}
else {
if (!_PyPopenCreateProcess(cmdstring,
! hChildStdinRd,
! hChildStdoutWr,
! hChildStderrWr))
return win32_error("CreateProcess", NULL);
}