summaryrefslogtreecommitdiffstats
path: root/recovery-persist.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2016-08-06 03:00:04 +0200
committerTianjie Xu <xunchang@google.com>2016-09-01 23:32:55 +0200
commitc21edd46541a6e1c3b7de43aa6002ea45b90c64a (patch)
tree53763973ea3ef46540e4c1071c6f1f29378d8abd /recovery-persist.cpp
parentMerge "Check an edge case when read(2) returns 0" am: 3202b8faf4 am: 852ae8d0fb (diff)
downloadandroid_bootable_recovery-c21edd46541a6e1c3b7de43aa6002ea45b90c64a.tar
android_bootable_recovery-c21edd46541a6e1c3b7de43aa6002ea45b90c64a.tar.gz
android_bootable_recovery-c21edd46541a6e1c3b7de43aa6002ea45b90c64a.tar.bz2
android_bootable_recovery-c21edd46541a6e1c3b7de43aa6002ea45b90c64a.tar.lz
android_bootable_recovery-c21edd46541a6e1c3b7de43aa6002ea45b90c64a.tar.xz
android_bootable_recovery-c21edd46541a6e1c3b7de43aa6002ea45b90c64a.tar.zst
android_bootable_recovery-c21edd46541a6e1c3b7de43aa6002ea45b90c64a.zip
Diffstat (limited to 'recovery-persist.cpp')
-rw-r--r--recovery-persist.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/recovery-persist.cpp b/recovery-persist.cpp
index 25df03f47..b0ec141cb 100644
--- a/recovery-persist.cpp
+++ b/recovery-persist.cpp
@@ -14,8 +14,6 @@
* limitations under the License.
*/
-#define LOG_TAG "recovery-persist"
-
//
// Strictly to deal with reboot into system after OTA after /data
// mounts to pull the last pmsg file data and place it
@@ -40,10 +38,9 @@
#include <string>
-#include <android/log.h> /* Android Log Priority Tags */
#include <android-base/file.h>
-#include <log/log.h>
-#include <log/logger.h> /* Android Log packet format */
+#include <android-base/logging.h>
+
#include <private/android_logger.h> /* private pmsg functions */
static const char *LAST_LOG_FILE = "/data/misc/recovery/last_log";
@@ -57,14 +54,16 @@ static const int KEEP_LOG_COUNT = 10;
// close a file, log an error if the error indicator is set
static void check_and_fclose(FILE *fp, const char *name) {
fflush(fp);
- if (ferror(fp)) SLOGE("%s %s", name, strerror(errno));
+ if (ferror(fp)) {
+ PLOG(ERROR) << "Error in " << name;
+ }
fclose(fp);
}
static void copy_file(const char* source, const char* destination) {
FILE* dest_fp = fopen(destination, "w");
if (dest_fp == nullptr) {
- SLOGE("%s %s", destination, strerror(errno));
+ PLOG(ERROR) << "Can't open " << destination;
} else {
FILE* source_fp = fopen(source, "r");
if (source_fp != nullptr) {
@@ -157,7 +156,7 @@ int main(int argc, char **argv) {
static const char mounts_file[] = "/proc/mounts";
FILE *fp = fopen(mounts_file, "r");
if (!fp) {
- SLOGV("%s %s", mounts_file, strerror(errno));
+ PLOG(ERROR) << "failed to open " << mounts_file;
} else {
char *line = NULL;
size_t len = 0;