summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'core/src')
-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);