summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorruki <[email protected]>2016-07-05 16:37:41 +0800
committerruki <[email protected]>2016-07-05 16:37:41 +0800
commit7af1dcdeed9e2ecbfc0ba0f4c34e52c99e1cdd89 (patch)
tree5d8b2b77ddca5024f350093f882c93a03f7a69e9 /core
parent7f75b2583b94e733ba0b974860174a9021bc8767 (diff)
uses os.exec instead of os.execute
Diffstat (limited to 'core')
-rwxr-xr-xcore/src/xmake/process/open.c5
-rwxr-xr-xcore/src/xmake/process/openv.c5
2 files changed, 4 insertions, 6 deletions
diff --git a/core/src/xmake/process/open.c b/core/src/xmake/process/open.c
index 2a2ee99af..55d4fab0b 100755
--- a/core/src/xmake/process/open.c
+++ b/core/src/xmake/process/open.c
@@ -78,9 +78,8 @@ tb_int_t xm_process_open(lua_State* lua)
// init process
tb_process_ref_t process = tb_process_init_cmd(command, &attr);
-
- // save the process reference
- lua_pushlightuserdata(lua, process);
+ if (process) lua_pushlightuserdata(lua, process);
+ else lua_pushnil(lua);
// ok
return 1;
diff --git a/core/src/xmake/process/openv.c b/core/src/xmake/process/openv.c
index 8f99c4535..692d18754 100755
--- a/core/src/xmake/process/openv.c
+++ b/core/src/xmake/process/openv.c
@@ -120,9 +120,8 @@ tb_int_t xm_process_openv(lua_State* lua)
// init process
tb_process_ref_t process = tb_process_init(shellname, argv, &attr);
-
- // save the process reference
- lua_pushlightuserdata(lua, process);
+ if (process) lua_pushlightuserdata(lua, process);
+ else lua_pushnil(lua);
// exit argv
if (argv) tb_free(argv);