logd: Allow (some) headers to be individually importable

(cherry pick from commit 2ad0bd0a9b)

LogReader.h needs to be individually importable.

Fix a few others, drop includes of local includes, let them be
included in source instead and allow headers to be included
alphabetically. Was not a complete audit since goal was to
separate LogReader.h out from the pack.

Bug: 27242723
Change-Id: Ic7759ef90995e5bd285810706af33550c73cf5b5
This commit is contained in:
Mark Salyzyn 2016-02-23 08:55:43 -08:00
parent df09aefc16
commit 317bfb923c
10 changed files with 28 additions and 5 deletions

View File

@ -16,7 +16,10 @@
#include <stdlib.h>
#include <private/android_filesystem_config.h>
#include "FlushCommand.h"
#include "LogBuffer.h"
#include "LogBufferElement.h"
#include "LogCommand.h"
#include "LogReader.h"

View File

@ -20,10 +20,13 @@
#include <limits.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <sys/prctl.h>
#include <sys/uio.h>
#include <syslog.h>
#include <string>
#include <cutils/properties.h>
#include <log/logger.h>
#include <private/android_filesystem_config.h>
@ -31,7 +34,9 @@
#include "libaudit.h"
#include "LogAudit.h"
#include "LogBuffer.h"
#include "LogKlog.h"
#include "LogReader.h"
#ifndef AUDITD_ENFORCE_INTEGRITY
#define AUDITD_ENFORCE_INTEGRITY false

View File

@ -18,7 +18,10 @@
#define _LOGD_LOG_AUDIT_H__
#include <sysutils/SocketListener.h>
#include "LogReader.h"
#include "LogBuffer.h"
class LogReader;
class LogAudit : public SocketListener {
LogBuffer *logbuf;

View File

@ -25,9 +25,11 @@
#include <log/logger.h>
#include <private/android_logger.h>
#include "LogBuffer.h"
#include "LogBufferElement.h"
#include "LogCommand.h"
#include "LogReader.h"
#include "LogUtils.h"
const uint64_t LogBufferElement::FLUSH_ERROR(0);
atomic_int_fast64_t LogBufferElement::sequence(1);

View File

@ -20,13 +20,16 @@
#include <limits.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <sys/prctl.h>
#include <sys/uio.h>
#include <syslog.h>
#include <log/logger.h>
#include "LogBuffer.h"
#include "LogKlog.h"
#include "LogReader.h"
#define KMSG_PRIORITY(PRI) \
'<', \

View File

@ -19,10 +19,12 @@
#include <sysutils/SocketListener.h>
#include <log/log_read.h>
#include "LogReader.h"
char *log_strntok_r(char *s, size_t *len, char **saveptr, size_t *sublen);
class LogBuffer;
class LogReader;
class LogKlog : public SocketListener {
LogBuffer *logbuf;
LogReader *reader;

View File

@ -27,6 +27,7 @@
#include <private/android_filesystem_config.h>
#include <private/android_logger.h>
#include "LogBuffer.h"
#include "LogListener.h"
#include "LogUtils.h"

View File

@ -21,8 +21,11 @@
#include <cutils/sockets.h>
#include "LogReader.h"
#include "FlushCommand.h"
#include "LogBuffer.h"
#include "LogBufferElement.h"
#include "LogReader.h"
#include "LogUtils.h"
LogReader::LogReader(LogBuffer *logbuf) :
SocketListener(getLogSocket(), true),

View File

@ -18,8 +18,8 @@
#define _LOGD_LOG_WRITER_H__
#include <sysutils/SocketListener.h>
#include "LogBuffer.h"
#include "LogTimes.h"
class LogBuffer;
class LogReader : public SocketListener {
LogBuffer &mLogbuf;

View File

@ -27,6 +27,7 @@
#include <log/log.h>
class LogReader;
class LogBufferElement;
class LogTimeEntry {
static pthread_mutex_t timesLock;