summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
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, 12 insertions, 12 deletions
diff --git a/core/src/xmake/process/open.c b/core/src/xmake/process/open.c
index feb000a66..b7ce59f52 100644
--- a/core/src/xmake/process/open.c
+++ b/core/src/xmake/process/open.c
@@ -59,11 +59,11 @@ tb_int_t xm_process_open(lua_State* lua)
{
// redirect stdout to file
attr.outfile = outfile;
- attr.outmode = TB_FILE_MODE_RW | TB_FILE_MODE_CREAT | TB_FILE_MODE_APPEND;
+ 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);
+ // if (tb_file_info(outfile, tb_null))
+ // tb_file_remove(outfile);
}
// redirect stderr?
@@ -71,11 +71,11 @@ tb_int_t xm_process_open(lua_State* lua)
{
// redirect stderr to file
attr.errfile = errfile;
- attr.errmode = TB_FILE_MODE_RW | TB_FILE_MODE_CREAT | TB_FILE_MODE_APPEND;
+ 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);
+ // if (tb_file_info(errfile, tb_null))
+ // tb_file_remove(errfile);
}
// init process
diff --git a/core/src/xmake/process/openv.c b/core/src/xmake/process/openv.c
index 58ec42d61..3d813568e 100644
--- a/core/src/xmake/process/openv.c
+++ b/core/src/xmake/process/openv.c
@@ -101,11 +101,11 @@ tb_int_t xm_process_openv(lua_State* lua)
{
// redirect stdout to file
attr.outfile = outfile;
- attr.outmode = TB_FILE_MODE_RW | TB_FILE_MODE_CREAT | TB_FILE_MODE_APPEND;
+ 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);
+ // if (tb_file_info(outfile, tb_null))
+ // tb_file_remove(outfile);
}
// redirect stderr?
@@ -113,11 +113,11 @@ tb_int_t xm_process_openv(lua_State* lua)
{
// redirect stderr to file
attr.errfile = errfile;
- attr.errmode = TB_FILE_MODE_RW | TB_FILE_MODE_CREAT | TB_FILE_MODE_APPEND;
+ 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);
+ // if (tb_file_info(errfile, tb_null))
+ // tb_file_remove(errfile);
}
// init process