summaryrefslogtreecommitdiff
path: root/PC/bdist_wininst/install.c
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2004-12-22 17:24:14 +0000
committerThomas Heller <theller@ctypes.org>2004-12-22 17:24:14 +0000
commitbaea7fff30fb78d855c86ccb3c466157cbf8b186 (patch)
treed70185ee018e1fa4ad4f6d222e69d1ccef492311 /PC/bdist_wininst/install.c
parenta488ce8b2bed5b9bfbecb1d7e74ca93a58d8366b (diff)
downloadcpython-baea7fff30fb78d855c86ccb3c466157cbf8b186.tar.gz
Close stdout and stderr, which are redirected into a temp file, before
trying to remove this file - the file was never removed before. Fixes [ 1067732 ] wininst --install-script leaves residual files Already backported.
Diffstat (limited to 'PC/bdist_wininst/install.c')
-rw-r--r--PC/bdist_wininst/install.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/PC/bdist_wininst/install.c b/PC/bdist_wininst/install.c
index be4be37905..e6e673144d 100644
--- a/PC/bdist_wininst/install.c
+++ b/PC/bdist_wininst/install.c
@@ -611,8 +611,8 @@ PyMethodDef meth[] = {
static HINSTANCE LoadPythonDll(char *fname)
{
char fullpath[_MAX_PATH];
- char subkey_name[80];
LONG size = sizeof(fullpath);
+ char subkey_name[80];
HINSTANCE h = LoadLibrary(fname);
if (h)
return h;
@@ -760,7 +760,9 @@ static int run_simple_script(char *script)
rc = do_run_simple_script(hPython, script);
FreeLibrary(hPython);
fflush(stderr);
+ fclose(stderr);
fflush(stdout);
+ fclose(stdout);
/* We only care about the output when we fail. If the script works
OK, then we discard it
*/
@@ -1951,7 +1953,9 @@ FinishedDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
fprintf(stderr, "*** Could not load Python ***");
}
fflush(stderr);
+ fclose(stderr);
fflush(stdout);
+ fclose(stdout);
fp = fopen(tempname, "rb");
n = fread(buffer, 1, sizeof(buffer), fp);
@@ -2299,7 +2303,9 @@ BOOL Run_RemoveScript(char *line)
}
fflush(stderr);
+ fclose(stderr);
fflush(stdout);
+ fclose(stdout);
fp = fopen(tempname, "rb");
n = fread(buffer, 1, sizeof(buffer), fp);