From 8c19b03d8e54adc58ffccfb0e3c8db89b38d1a20 Mon Sep 17 00:00:00 2001 From: TitanSnow Date: Mon, 22 May 2017 07:53:24 +0800 Subject: use euid as tmpdir suffix --- xmake/core/base/os.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index a607e1214..8bb67e1db 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -422,13 +422,10 @@ end -- get the temporary directory function os.tmpdir() - -- attempt get user name - os._USER = os._USER or os.getenv("USER") - -- get a temporary directory for each user local tmpdir = os._tmpdir() - if os._USER and #os._USER > 0 then - tmpdir = path.join(tmpdir, ".xmake_" .. os._USER) + if os.uid then + tmpdir = path.join(tmpdir, ".xmake_" .. os.uid().euid) else tmpdir = path.join(tmpdir, ".xmake") end -- cgit v1.3.1