diff options
| author | ruki <[email protected]> | 2019-08-18 10:48:20 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-08-18 10:48:20 +0800 |
| commit | 870440fe4ff1523e142e0eafae0a38cf3cfe4915 (patch) | |
| tree | 4403af893e555d3cfa781b738f44ae8c9df56287 /xmake/core/sandbox/modules/process.lua | |
| parent | 2c5d7d443fcda38f50dae1a0050eca5ff6ef531f (diff) | |
rewrite filelock
Diffstat (limited to 'xmake/core/sandbox/modules/process.lua')
| -rw-r--r-- | xmake/core/sandbox/modules/process.lua | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/xmake/core/sandbox/modules/process.lua b/xmake/core/sandbox/modules/process.lua index 24872e8c1..7bfb8ef5d 100644 --- a/xmake/core/sandbox/modules/process.lua +++ b/xmake/core/sandbox/modules/process.lua @@ -66,15 +66,19 @@ function sandbox_process.open(command, opt) end -- hook subprocess interfaces + local hooked = {} for name, func in pairs(proc) do if not name:startswith("_") and type(func) == "function" then local newfunc = sandbox_process_subprocess[name] if newfunc ~= nil then - proc["_" .. name] = proc["_" .. name] or func - proc[name] = newfunc + hooked["_" .. name] = proc["_" .. name] or func + hooked[name] = newfunc end end end + for name, func in pairs(hooked) do + proc[name] = func + end return proc end @@ -99,15 +103,19 @@ function sandbox_process.openv(filename, argv, opt) end -- hook subprocess interfaces + local hooked = {} for name, func in pairs(proc) do if not name:startswith("_") and type(func) == "function" then local newfunc = sandbox_process_subprocess[name] if newfunc ~= nil then - proc["_" .. name] = proc["_" .. name] or func - proc[name] = newfunc + hooked["_" .. name] = proc["_" .. name] or func + hooked[name] = newfunc end end end + for name, func in pairs(hooked) do + proc[name] = func + end return proc end |
