summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTitanSnow <[email protected]>2017-05-22 07:53:24 +0800
committerTitanSnow <[email protected]>2017-05-22 07:53:24 +0800
commit8c19b03d8e54adc58ffccfb0e3c8db89b38d1a20 (patch)
treedde5177d3a12a3d85e9c5802aadc9ba15c95e1db
parent24cf9ef118cb14176b7f750e71db92a8c599823a (diff)
use euid as tmpdir suffix
-rw-r--r--xmake/core/base/os.lua7
1 files 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