From 8e1d22d26a44ff95d7c13330eabec98a7a061eae Mon Sep 17 00:00:00 2001 From: midipix Date: Wed, 13 Jun 2018 06:13:48 +0000 Subject: ntux_cmd_strace(): open the log file with O_TRUNC. --- src/cmds/ntux_cmd_strace.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/cmds') 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 +#include + #include #include #include @@ -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 { -- cgit v1.2.3