logd: liblog: logcat: switch to android_log_clockid() (2)
android_log_timestamp returns the property leading letter,
it is better to return a clockid_t with android_log_clockid()
Bug: 23668800
Change-Id: I38dee773bf3844177826b03a26b03215c79a5359
diff --git a/logcat/logcat.cpp b/logcat/logcat.cpp
index 22645f5..0c59f23 100644
--- a/logcat/logcat.cpp
+++ b/logcat/logcat.cpp
@@ -398,11 +398,9 @@
return retval;
}
- log_time now(CLOCK_REALTIME);
- bool monotonic = android_log_timestamp() == 'm';
- if (monotonic) {
- now = log_time(CLOCK_MONOTONIC);
- }
+ clockid_t clock_type = android_log_clockid();
+ log_time now(clock_type);
+ bool monotonic = clock_type == CLOCK_MONOTONIC;
std::string directory;
char *file = strrchr(outputFileName, '/');