[Python-checkins] python/dist/src/PC/bdist_wininst install.c, 1.12, 1.13

theller at users.sourceforge.net theller at users.sourceforge.net
Wed Dec 22 18:24:17 CET 2004


Update of /cvsroot/python/python/dist/src/PC/bdist_wininst
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15113
Modified Files:
	install.c 
Log Message:
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.
Index: install.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/PC/bdist_wininst/install.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- install.c	1 Dec 2004 19:43:02 -0000	1.12
+++ install.c	22 Dec 2004 17:24:14 -0000	1.13
@@ -611,8 +611,8 @@
 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 @@
 	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 @@
 				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 @@
 		}
 	
 		fflush(stderr);
+		fclose(stderr);
 		fflush(stdout);
+		fclose(stdout);
 	
 		fp = fopen(tempname, "rb");
 		n = fread(buffer, 1, sizeof(buffer), fp);


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /