From 8498016b81a393e48ce1e3060872b841298708a3 Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Mon, 23 Jan 2017 15:56:35 -0800 Subject: [PATCH] tombstoned: silence spurious error messages. Bug: none Test: booted after deleting /data/tombstones/* Test: crasher creates a tombstone Change-Id: I8b3e8a3b521952412ebc955b2437bf8150220c16 --- debuggerd/tombstoned/tombstoned.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/debuggerd/tombstoned/tombstoned.cpp b/debuggerd/tombstoned/tombstoned.cpp index 63e3dbd07..8705ecea5 100644 --- a/debuggerd/tombstoned/tombstoned.cpp +++ b/debuggerd/tombstoned/tombstoned.cpp @@ -85,7 +85,13 @@ static void find_oldest_tombstone() { std::string path = android::base::StringPrintf("%stombstone_%02zu", kTombstoneDirectory, i); struct stat st; if (stat(path.c_str(), &st) != 0) { - PLOG(ERROR) << "failed to stat " << path; + if (errno == ENOENT) { + oldest_tombstone = i; + break; + } else { + PLOG(ERROR) << "failed to stat " << path; + continue; + } } if (st.st_mtime < oldest_time) {