Commit 20006966 authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

winegcc: Respect TMPDIR environment variable.

parent dcdf4dbf
......@@ -268,9 +268,12 @@ static char* get_temp_file(const char* prefix, const char* suffix)
fd = mkstemps( tmp, strlen(suffix) );
if (fd == -1)
{
/* could not create it in current directory, try in /tmp */
/* could not create it in current directory, try in TMPDIR */
const char* tmpdir;
free(tmp);
tmp = strmake("/tmp/%s-XXXXXX%s", prefix, suffix);
if (!(tmpdir = getenv("TMPDIR"))) tmpdir = "/tmp";
tmp = strmake("%s/%s-XXXXXX%s", tmpdir, prefix, suffix);
fd = mkstemps( tmp, strlen(suffix) );
if (fd == -1) error( "could not create temp file\n" );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment