OSDN Git Service
(root)
/
android-x86
/
frameworks-native.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6481ebf
)
Truncate trace output files.
author
Martijn Coenen
<maco@google.com>
Wed, 22 Feb 2017 08:25:31 +0000
(09:25 +0100)
committer
Martijn Coenen
<maco@google.com>
Wed, 22 Feb 2017 08:25:31 +0000
(09:25 +0100)
To avoid creating trace files with garbage at the end.
Bug:
35588070
Test: atrace runs
Change-Id: I26ef4c652ca2e2dd8ff9d11d4f380b44791cb960
cmds/atrace/atrace.cpp
patch
|
blob
|
history
diff --git
a/cmds/atrace/atrace.cpp
b/cmds/atrace/atrace.cpp
index
a6cde79
..
965a78e
100644
(file)
--- a/
cmds/atrace/atrace.cpp
+++ b/
cmds/atrace/atrace.cpp
@@
-1239,7
+1239,7
@@
int main(int argc, char **argv)
fflush(stdout);
int outFd = STDOUT_FILENO;
if (g_outputFile) {
- outFd = open(g_outputFile, O_WRONLY | O_CREAT, 0644);
+ outFd = open(g_outputFile, O_WRONLY | O_CREAT
| O_TRUNC
, 0644);
}
if (outFd == -1) {
printf("Failed to open '%s', err=%d", g_outputFile, errno);