diff options
author | midipix <writeonce@midipix.org> | 2018-06-13 06:13:48 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2018-06-13 12:14:36 -0400 |
commit | 8e1d22d26a44ff95d7c13330eabec98a7a061eae (patch) | |
tree | 2fe97c30dbfa77268d6c19fef4997361597c8274 /src | |
parent | 0794af3ae893abc2b3ef76daee2002051ba15f5f (diff) | |
download | ntux-8e1d22d26a44ff95d7c13330eabec98a7a061eae.tar.bz2 ntux-8e1d22d26a44ff95d7c13330eabec98a7a061eae.tar.xz |
ntux_cmd_strace(): open the log file with O_TRUNC.
Diffstat (limited to 'src')
-rw-r--r-- | src/cmds/ntux_cmd_strace.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cmds/ntux_cmd_strace.c b/src/cmds/ntux_cmd_strace.c index 08d7eb4..b434189 100644 --- a/src/cmds/ntux_cmd_strace.c +++ b/src/cmds/ntux_cmd_strace.c @@ -5,6 +5,8 @@ /***********************************************************/ #include <ntapi/ntapi.h> +#include <ntapi/nt_termios.h> + #include <psxabi/sys_sysapi.h> #include <psxabi/sys_strace.h> #include <psxabi/sys_fcntl.h> @@ -44,7 +46,7 @@ int ntux_cmd_strace(const struct ntux_driver_ctx * dctx) /* fdlog */ if (logfile) { - if ((fdlog[1] = __sys_open(logfile,O_CREAT|O_WRONLY,0)) < 0) + if ((fdlog[1] = __sys_open(logfile,O_CREAT|O_TRUNC|O_WRONLY,0)) < 0) if (ntux_errno_set(dctx,fdlog[1])) return NTUX_SYSTEM_ERROR(dctx); } else { |