summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-12-28 18:33:36 +1100
committerdaurnimator <quae@daurnimator.com>2017-12-28 20:25:17 +1100
commitad9d1bef4abdf64a447964a5018cb01fd640f3b0 (patch)
tree1e0920bdb2dbcc029f8555cb626a7f1214e22d99
parent2fcd2a4b326f386a3689e40f7f717496cd03e72e (diff)
downloadfengari-ad9d1bef4abdf64a447964a5018cb01fd640f3b0.tar.gz
fengari-ad9d1bef4abdf64a447964a5018cb01fd640f3b0.tar.bz2
fengari-ad9d1bef4abdf64a447964a5018cb01fd640f3b0.zip
src/loslib.js: fix os.execute(nil) case
-rw-r--r--src/loslib.js17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/loslib.js b/src/loslib.js
index f27a7ed..83da409 100644
--- a/src/loslib.js
+++ b/src/loslib.js
@@ -257,18 +257,11 @@ if (typeof process === "undefined") {
return lauxlib.luaL_execresult(L, null);
} else {
- try {
- child_process.execSync(
- Uint8Array.from(cmd),
- {
- stdio: [process.stdin, process.stdout, process.stderr]
- }
- );
- lua.lua_pushboolean(L, 1);
- } catch (e) {
- lua.lua_pushboolean(L, 0);
- }
-
+ /* Assume a shell is available.
+ If it's good enough for musl it's good enough for us.
+ http://git.musl-libc.org/cgit/musl/tree/src/process/system.c?id=ac45692a53a1b8d2ede329d91652d43c1fb5dc8d#n22
+ */
+ lua.lua_pushboolean(L, 1);
return 1;
}
};