Loading logcat/logcat.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ #include <stdlib.h> #include <string.h> #include <sys/cdefs.h> #include <sys/resource.h> #include <sys/socket.h> #include <sys/stat.h> #include <sys/types.h> Loading @@ -33,6 +34,7 @@ #include <log/logd.h> #include <log/logger.h> #include <log/logprint.h> #include <utils/threads.h> #define DEFAULT_MAX_ROTATED_LOGS 4 Loading Loading @@ -221,6 +223,10 @@ static void setupOutput() fprintf(stderr, "failed to set to batch scheduler\n"); } if (setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_BACKGROUND) < 0) { fprintf(stderr, "failed set to priority\n"); } g_outFD = openLogFile (g_outputFileName); if (g_outFD < 0) { Loading logd/main.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ #include <sys/capability.h> #include <sys/klog.h> #include <sys/prctl.h> #include <sys/resource.h> #include <sys/stat.h> #include <sys/types.h> #include <syslog.h> Loading @@ -37,6 +38,7 @@ #include <cutils/sockets.h> #include <log/event_tag_map.h> #include <private/android_filesystem_config.h> #include <utils/threads.h> #include "CommandListener.h" #include "LogBuffer.h" Loading Loading @@ -91,6 +93,10 @@ static int drop_privs() { return -1; } if (setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_BACKGROUND) < 0) { return -1; } if (prctl(PR_SET_KEEPCAPS, 1) < 0) { return -1; } Loading Loading @@ -156,6 +162,7 @@ static LogBuffer *logBuf = NULL; static void *reinit_thread_start(void * /*obj*/) { prctl(PR_SET_NAME, "logd.daemon"); set_sched_policy(0, SP_BACKGROUND); setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_BACKGROUND); setgid(AID_SYSTEM); setuid(AID_SYSTEM); Loading Loading
logcat/logcat.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ #include <stdlib.h> #include <string.h> #include <sys/cdefs.h> #include <sys/resource.h> #include <sys/socket.h> #include <sys/stat.h> #include <sys/types.h> Loading @@ -33,6 +34,7 @@ #include <log/logd.h> #include <log/logger.h> #include <log/logprint.h> #include <utils/threads.h> #define DEFAULT_MAX_ROTATED_LOGS 4 Loading Loading @@ -221,6 +223,10 @@ static void setupOutput() fprintf(stderr, "failed to set to batch scheduler\n"); } if (setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_BACKGROUND) < 0) { fprintf(stderr, "failed set to priority\n"); } g_outFD = openLogFile (g_outputFileName); if (g_outFD < 0) { Loading
logd/main.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ #include <sys/capability.h> #include <sys/klog.h> #include <sys/prctl.h> #include <sys/resource.h> #include <sys/stat.h> #include <sys/types.h> #include <syslog.h> Loading @@ -37,6 +38,7 @@ #include <cutils/sockets.h> #include <log/event_tag_map.h> #include <private/android_filesystem_config.h> #include <utils/threads.h> #include "CommandListener.h" #include "LogBuffer.h" Loading Loading @@ -91,6 +93,10 @@ static int drop_privs() { return -1; } if (setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_BACKGROUND) < 0) { return -1; } if (prctl(PR_SET_KEEPCAPS, 1) < 0) { return -1; } Loading Loading @@ -156,6 +162,7 @@ static LogBuffer *logBuf = NULL; static void *reinit_thread_start(void * /*obj*/) { prctl(PR_SET_NAME, "logd.daemon"); set_sched_policy(0, SP_BACKGROUND); setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_BACKGROUND); setgid(AID_SYSTEM); setuid(AID_SYSTEM); Loading