summaryrefslogtreecommitdiff
path: root/xmake/core/base
diff options
context:
space:
mode:
authorruki <[email protected]>2022-04-05 23:52:12 +0800
committerruki <[email protected]>2022-04-05 23:52:12 +0800
commit43431946fbd66c1ff6c9726e93527efa7cf7dc98 (patch)
tree30fa88458d5ac568fee81f62ba8d70023ee81533 /xmake/core/base
parent314f11d73d924d8ff8340fb989a545149850dfda (diff)
revert gid uid
Diffstat (limited to 'xmake/core/base')
-rw-r--r--xmake/core/base/os.lua20
1 files changed, 10 insertions, 10 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua
index daff4d75b..2f44afa38 100644
--- a/xmake/core/base/os.lua
+++ b/xmake/core/base/os.lua
@@ -31,8 +31,8 @@ local string = require("base/string")
local process = require("base/process")
-- save original interfaces
-os._getuid = os._getuid or os.getuid or os.uid -- for old core
-os._getgid = os._getgid or os.getgid or os.gid
+os._uid = os._uid or os.uid
+os._gid = os._gid or os.gid
os._getpid = os._getpid or os.getpid
os._exit = os._exit or os.exit
os._mkdir = os._mkdir or os.mkdir
@@ -610,7 +610,7 @@ function os.tmpdir(opt)
local subdir = os._TMPSUBDIR
if not subdir then
local name = "." .. xmake._NAME
- subdir = path.join((os._FAKEROOT and (name .. "fake") or name) .. (os.getuid().euid or ""), os.date("%y%m%d"))
+ subdir = path.join((os._FAKEROOT and (name .. "fake") or name) .. (os.uid().euid or ""), os.date("%y%m%d"))
os._TMPSUBDIR = subdir
end
@@ -975,19 +975,19 @@ function os.nuldev(input)
end
-- get uid
-function os.getuid(...)
+function os.uid(...)
os._UID = {}
- if os._getuid then
- os._UID = os._getuid(...) or {}
+ if os._uid then
+ os._UID = os._uid(...) or {}
end
return os._UID
end
-- get gid
-function os.getgid(...)
+function os.gid(...)
os._GID = {}
- if os._getgid then
- os._GID = os._getgid(...) or {}
+ if os._gid then
+ os._GID = os._gid(...) or {}
end
return os._GID
end
@@ -1004,7 +1004,7 @@ end
-- check the current command is running as root
function os.isroot()
- return os.getuid().euid == 0
+ return os.uid().euid == 0
end
-- is case-insensitive filesystem?