X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Fcore%2Fluasrc%2Fccache.lua;h=56ccbc3efe30a85bfb15544818ad0d49a0ad840f;hp=c9771af216b4af3de0a02ef775f64b431c64db75;hb=d4987d7863baf1071d2c1579c8730cf44538fd45;hpb=ffec6bd4516107205ec5af4c64d8018c36a5dafe diff --git a/libs/core/luasrc/ccache.lua b/libs/core/luasrc/ccache.lua index c9771af21..56ccbc3ef 100644 --- a/libs/core/luasrc/ccache.lua +++ b/libs/core/luasrc/ccache.lua @@ -37,7 +37,7 @@ function cache_enable(cachepath, mode) mode = mode or "r--r--r--" local loader = package.loaders[2] - local uid = nixio.getpid("uid") + local uid = nixio.getuid() if not fs.stat(cachepath) then fs.mkdir(cachepath) @@ -53,7 +53,7 @@ function cache_enable(cachepath, mode) local function _load_sane(file) local stat = fs.stat(file) - if stat and stat.uid == uid and stat.mode == mode then + if stat and stat.uid == uid and stat.modestr == mode then return loadfile(file) end end