=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: winegcc: Respect TMPDIR environment variable.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Sep 24 15:28:36 CDT 2014


Module: wine
Branch: master
Commit: 20006966ab737e3da0ed107cf0dfb1e349be205d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=20006966ab737e3da0ed107cf0dfb1e349be205d

Author: André Hentschel <nerv at dawncrow.de>
Date:   Tue Sep 23 22:22:28 2014 +0200

winegcc: Respect TMPDIR environment variable.

---

 tools/winegcc/winegcc.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index 72e2e69..a2f09d2 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -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" );
     }




More information about the wine-cvs mailing list