[Python-checkins] CVS: python/dist/src/PC WinMain.c,1.4,1.5
Fredrik Lundh
python-dev@python.org
Sat, 8 Jul 2000 13:50:01 -0700
Update of /cvsroot/python/python/dist/src/PC
In directory slayer.i.sourceforge.net:/tmp/cvs-serv11792/PC
Modified Files:
WinMain.c
Log Message:
- removed barry's workaround, to make room for
bill's more complete solution.
Index: WinMain.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/PC/WinMain.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** WinMain.c 2000/07/08 18:06:41 1.4
--- WinMain.c 2000/07/08 20:49:58 1.5
***************
*** 3,8 ****
#define WINDOWS_LEAN_AND_MEAN
#include <windows.h>
- #include <fcntl.h>
- #include <sys/stat.h>
#include "Python.h"
--- 3,6 ----
***************
*** 17,48 ****
)
{
- int null_file;
-
- /*
- * make sure that the C RTL has valid file descriptors for
- * stdin, stdout, stderr. Use the NUL device if necessary.
- * This allows popen to work under pythonw.
- *
- * When pythonw.exe starts the C RTL function _ioinit is called
- * first. WinMain is called later hence the need to check for
- * invalid handles.
- *
- * Note: FILE stdin, stdout, stderr do not use the file descriptors
- * setup here. They are already initialised before WinMain was called.
- */
-
- null_file = open("NUL", _O_RDWR);
-
- if (_get_osfhandle(0) == -1)
- dup2(null_file, 0);
-
- if (_get_osfhandle(1) == -1)
- dup2(null_file, 1);
-
- if (_get_osfhandle(2) == -1)
- dup2(null_file, 2);
-
- close(null_file);
-
return Py_Main(__argc, __argv);
}
--- 15,18 ----