From 62cb9b70b1682156c8f8a160eb18604b2226a5b2 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 23 May 2017 15:29:22 +0800 Subject: fix os.iorunv and process bug with multi-jobs --- core/src/xmake/process/open.c | 12 ++---------- core/src/xmake/process/openv.c | 12 ++---------- 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 -- cgit v1.3.1