diff options
| author | 2017-01-13 22:09:40 -0800 | |
|---|---|---|
| committer | 2017-01-17 13:55:20 -0800 | |
| commit | 989b812dcd0d0a52de0d59fcf307ee3ee2b1bdee (patch) | |
| tree | b155efc1c7fd7c8fc68f27b9e8936f72585a642c /cmds/dumpstate/utils.cpp | |
| parent | d2db024a868706547ff55b1be8a9ee1a154b911c (diff) | |
dumpstate: use O_APPEND for anr file.
Bug: http://b/30705528
Test: ran dumpstate, grepped dmesg for new selinux denials
Change-Id: I28814edcf37a7edbde79279feff0e7def64316f2
Diffstat (limited to 'cmds/dumpstate/utils.cpp')
| -rw-r--r-- | cmds/dumpstate/utils.cpp | 6 |
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; |