From 8f67c3e045f85782016e30b5950b271b27058ae4 Mon Sep 17 00:00:00 2001 From: Thomas Heller Date: Wed, 22 Dec 2004 15:35:20 +0000 Subject: [PATCH] Backport a patch from Mark Hammond. Partial fix for [1067732] - "wininst --install-script leaves residual files on C:\" 'tempnam()' is used rather than 'tmpnam()' - 'tmpnam' creates a temp file on the root of the current drive, and if this is readonly explains the 'freopen' errors occasionally reported. 'tempnam' creates the temp file in the %TEMP% directory. --- PC/bdist_wininst/install.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PC/bdist_wininst/install.c b/PC/bdist_wininst/install.c index 8a92364f3f82..b6066e1bad10 100644 --- a/PC/bdist_wininst/install.c +++ b/PC/bdist_wininst/install.c @@ -1708,7 +1708,7 @@ FinishedDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) if (logfile) fprintf(logfile, "300 Run Script: [%s]%s\n", pythondll, fname); - tempname = tmpnam(NULL); + tempname = tempnam(NULL, NULL); if (!freopen(tempname, "a", stderr)) MessageBox(GetFocus(), "freopen stderr", NULL, MB_OK); @@ -2067,7 +2067,7 @@ BOOL Run_RemoveScript(char *line) argv[0] = scriptname; - tempname = tmpnam(NULL); + tempname = tempnam(NULL, NULL); if (!freopen(tempname, "a", stderr)) MessageBox(GetFocus(), "freopen stderr", NULL, MB_OK); -- 2.47.3