summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2017-03-14 15:25:46 -0700
committerMark Salyzyn <salyzyn@google.com>2017-03-14 15:35:15 -0700
commitd70f246f8a402024db325f15bdf398c9608d54cc (patch)
tree6b8800f669753a8573d8e259d61dc982d9548e2f
parentf31abeb9735d97dd386580b250ad744453009356 (diff)
logcat: test: tail_# occasional failures
When PID becomes 5 digits, fgetLongTime fails Test: gTest logcat-unit-tests --gtest_filter=*.tail_* Bug: 27319267 Change-Id: I9cc636ed9955a317eb3b0ff0a820a50b800b7e0d
-rw-r--r--logcat/tests/logcat_test.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/logcat/tests/logcat_test.cpp b/logcat/tests/logcat_test.cpp
index dad74ee4b..0895834b2 100644
--- a/logcat/tests/logcat_test.cpp
+++ b/logcat/tests/logcat_test.cpp
@@ -208,9 +208,9 @@ static char* fgetLongTime(char* buffer, size_t buflen, FILE* fp) {
if ((*ep != '-') && (*ep != '.')) {
continue;
}
- // Find PID field
+ // Find PID field. Look for ': ' or ':[0-9][0-9][0-9]'
while (((ep = strchr(ep, ':'))) && (*++ep != ' ')) {
- ;
+ if (isdigit(ep[0]) && isdigit(ep[1]) && isdigit(ep[2])) break;
}
if (!ep) {
continue;