summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nick Kralevich <nnk@google.com> 2015-07-25 21:13:49 -0700
committer Nick Kralevich <nnk@google.com> 2015-07-25 21:13:49 -0700
commitf0b539618fbf7ea3800461b757cf416a3369b6cb (patch)
tree167e782e59a68e4388a7a54ecf63152273b253b2
parent25b2ed03487b7c7b4e5e6897525a169ee32b1998 (diff)
dumpstate: remove unnecessary mkdir
/data/anr is now created in init.rc. This code is unnecessary. Bug: 22385254 Change-Id: I4ea9c311d52eee7fb6b90235fbd12a4c9364d71f
-rw-r--r--cmds/dumpstate/utils.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/cmds/dumpstate/utils.c b/cmds/dumpstate/utils.c
index 44ba025ca0..fbb0331eb0 100644
--- a/cmds/dumpstate/utils.c
+++ b/cmds/dumpstate/utils.c
@@ -642,24 +642,6 @@ const char *dump_traces() {
return NULL; // Can't rename old traces.txt -- no permission? -- leave it alone instead
}
- /* make the directory if necessary */
- char anr_traces_dir[PATH_MAX];
- strlcpy(anr_traces_dir, traces_path, sizeof(anr_traces_dir));
- char *slash = strrchr(anr_traces_dir, '/');
- if (slash != NULL) {
- *slash = '\0';
- if (!mkdir(anr_traces_dir, 0775)) {
- chown(anr_traces_dir, AID_SYSTEM, AID_SYSTEM);
- chmod(anr_traces_dir, 0775);
- if (selinux_android_restorecon(anr_traces_dir, 0) == -1) {
- fprintf(stderr, "restorecon failed for %s: %s\n", anr_traces_dir, strerror(errno));
- }
- } else if (errno != EEXIST) {
- fprintf(stderr, "mkdir(%s): %s\n", anr_traces_dir, strerror(errno));
- return NULL;
- }
- }
-
/* 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- */