summaryrefslogtreecommitdiff
path: root/cmds/dumpstate/utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cmds/dumpstate/utils.cpp')
-rw-r--r--cmds/dumpstate/utils.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmds/dumpstate/utils.cpp b/cmds/dumpstate/utils.cpp
index 139231cdc9..4ac5b67ef1 100644
--- a/cmds/dumpstate/utils.cpp
+++ b/cmds/dumpstate/utils.cpp
@@ -1021,8 +1021,10 @@ const char *dump_traces() {
}
/* create a new, empty traces.txt file to receive stack dumps */
- int fd = TEMP_FAILURE_RETRY(open(traces_path, O_CREAT | O_WRONLY | O_TRUNC | O_NOFOLLOW | O_CLOEXEC,
- 0666)); /* -rw-rw-rw- */
+ int fd = TEMP_FAILURE_RETRY(
+ open(traces_path,
+ O_CREAT | O_WRONLY | O_APPEND | O_TRUNC | O_NOFOLLOW | O_CLOEXEC,
+ 0666)); /* -rw-rw-rw- */
if (fd < 0) {
MYLOGE("%s: %s\n", traces_path, strerror(errno));
return NULL;