From 797ba4fbf415cc1cd5609965a494738a40039d18 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Wed, 2 Dec 2020 00:55:22 -0800 Subject: [PATCH] Make sure all logging ends with newline --- native/jni/core/bootstages.cpp | 2 +- native/jni/core/db.cpp | 2 +- native/jni/core/socket.cpp | 2 +- native/jni/su/su_daemon.cpp | 4 ++-- native/jni/utils/stream.cpp | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/native/jni/core/bootstages.cpp b/native/jni/core/bootstages.cpp index ee359667c..75655d75f 100644 --- a/native/jni/core/bootstages.cpp +++ b/native/jni/core/bootstages.cpp @@ -61,7 +61,7 @@ static void mount_mirrors() { char buf1[4096]; char buf2[4096]; - LOGI("* Mounting mirrors"); + LOGI("* Mounting mirrors\n"); parse_mnt("/proc/mounts", [&](mntent *me) { struct stat st; diff --git a/native/jni/core/db.cpp b/native/jni/core/db.cpp index a843909f9..b196d7c2a 100644 --- a/native/jni/core/db.cpp +++ b/native/jni/core/db.cpp @@ -359,7 +359,7 @@ bool validate_manager(string &pkg, int userid, struct stat *st) { // Check the official package name sprintf(app_path, "%s/%d/" JAVA_PACKAGE_NAME, APP_DATA_DIR, userid); if (stat(app_path, st)) { - LOGE("su: cannot find manager"); + LOGE("su: cannot find manager\n"); memset(st, 0, sizeof(*st)); pkg.clear(); return false; diff --git a/native/jni/core/socket.cpp b/native/jni/core/socket.cpp index 8ed5bf562..06faf539e 100644 --- a/native/jni/core/socket.cpp +++ b/native/jni/core/socket.cpp @@ -82,7 +82,7 @@ int recv_fd(int sockfd) { cmsg->cmsg_level != SOL_SOCKET || cmsg->cmsg_type != SCM_RIGHTS) { error: - LOGE("unable to read fd"); + LOGE("unable to read fd\n"); exit(-1); } diff --git a/native/jni/su/su_daemon.cpp b/native/jni/su/su_daemon.cpp index 0bf12e689..ee4c0d884 100644 --- a/native/jni/su/su_daemon.cpp +++ b/native/jni/su/su_daemon.cpp @@ -185,7 +185,7 @@ void su_daemon_handler(int client, struct ucred *credential) { // Fail fast if (ctx.info->access.policy == DENY) { - LOGW("su: request rejected (%u)", ctx.info->uid); + LOGW("su: request rejected (%u)\n", ctx.info->uid); ctx.info.reset(); write_int(client, DENY); close(client); @@ -244,7 +244,7 @@ void su_daemon_handler(int client, struct ucred *credential) { // If caller is not root, ensure the owner of pts_slave is the caller if(st.st_uid != ctx.info->uid && ctx.info->uid != 0) - LOGE("su: Wrong permission of pts_slave"); + LOGE("su: Wrong permission of pts_slave\n"); // Opening the TTY has to occur after the // fork() and setsid() so that it becomes diff --git a/native/jni/utils/stream.cpp b/native/jni/utils/stream.cpp index ef29a2946..076baf8c0 100644 --- a/native/jni/utils/stream.cpp +++ b/native/jni/utils/stream.cpp @@ -29,17 +29,17 @@ sFILE make_stream_fp(stream_ptr &&strm) { } int stream::read(void *buf, size_t len) { - LOGE("This stream does not support read"); + LOGE("This stream does not support read\n"); return -1; } int stream::write(const void *buf, size_t len) { - LOGE("This stream does not support write"); + LOGE("This stream does not support write\n"); return -1; } off_t stream::seek(off_t off, int whence) { - LOGE("This stream does not support seek"); + LOGE("This stream does not support seek\n"); return -1; }