summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorruki <[email protected]>2017-05-23 15:29:22 +0800
committerruki <[email protected]>2017-05-23 15:29:22 +0800
commit62cb9b70b1682156c8f8a160eb18604b2226a5b2 (patch)
tree30cb7f85b426b4b17e964a7ba87428bd8729db6f /core/src
parentf175b61df1fb13331d0650148f988296ff7682a7 (diff)
fix os.iorunv and process bug with multi-jobs
Diffstat (limited to 'core/src')
-rw-r--r--core/src/xmake/process/open.c12
-rw-r--r--core/src/xmake/process/openv.c12
2 files changed, 4 insertions, 20 deletions
diff --git a/core/src/xmake/process/open.c b/core/src/xmake/process/open.c
index b7ce59f52..2365ee7ba 100644
--- a/core/src/xmake/process/open.c
+++ b/core/src/xmake/process/open.c
@@ -59,11 +59,7 @@ tb_int_t xm_process_open(lua_State* lua)
{
// redirect stdout to file
attr.outfile = outfile;
- attr.outmode = TB_FILE_MODE_WO | TB_FILE_MODE_TRUNC | TB_FILE_MODE_CREAT;
-
- // remove the outfile first
- // if (tb_file_info(outfile, tb_null))
- // tb_file_remove(outfile);
+ attr.outmode = TB_FILE_MODE_RW | TB_FILE_MODE_TRUNC | TB_FILE_MODE_CREAT;
}
// redirect stderr?
@@ -71,11 +67,7 @@ tb_int_t xm_process_open(lua_State* lua)
{
// redirect stderr to file
attr.errfile = errfile;
- attr.errmode = TB_FILE_MODE_WO | TB_FILE_MODE_TRUNC | TB_FILE_MODE_CREAT;
-
- // remove the errfile first
- // if (tb_file_info(errfile, tb_null))
- // tb_file_remove(errfile);
+ attr.errmode = TB_FILE_MODE_RW | TB_FILE_MODE_TRUNC | TB_FILE_MODE_CREAT;
}
// init process
diff --git a/core/src/xmake/process/openv.c b/core/src/xmake/process/openv.c
index 3d813568e..1013f38fb 100644
--- a/core/src/xmake/process/openv.c
+++ b/core/src/xmake/process/openv.c
@@ -101,11 +101,7 @@ tb_int_t xm_process_openv(lua_State* lua)
{
// redirect stdout to file
attr.outfile = outfile;
- attr.outmode = TB_FILE_MODE_WO | TB_FILE_MODE_TRUNC | TB_FILE_MODE_CREAT;
-
- // remove the outfile first
- // if (tb_file_info(outfile, tb_null))
- // tb_file_remove(outfile);
+ attr.outmode = TB_FILE_MODE_RW | TB_FILE_MODE_TRUNC | TB_FILE_MODE_CREAT;
}
// redirect stderr?
@@ -113,11 +109,7 @@ tb_int_t xm_process_openv(lua_State* lua)
{
// redirect stderr to file
attr.errfile = errfile;
- attr.errmode = TB_FILE_MODE_WO | TB_FILE_MODE_TRUNC | TB_FILE_MODE_CREAT;
-
- // remove the errfile first
- // if (tb_file_info(errfile, tb_null))
- // tb_file_remove(errfile);
+ attr.errmode = TB_FILE_MODE_RW | TB_FILE_MODE_TRUNC | TB_FILE_MODE_CREAT;
}
// init process