summaryrefslogtreecommitdiffstats
path: root/logd
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2016-02-23 08:55:43 -0800
committerMark Salyzyn <salyzyn@google.com>2016-02-24 10:15:22 -0800
commit2ad0bd0a9b594bbe2560b405b0008b7bc742cfca (patch)
tree2de6c0ddd157f81b0b949f06b35e26bbdc46ca98 /logd
parent978cda5cc64bd0c0fe1915074bbf6237b2214faa (diff)
downloadcore-2ad0bd0a9b594bbe2560b405b0008b7bc742cfca.tar.gz
core-2ad0bd0a9b594bbe2560b405b0008b7bc742cfca.tar.bz2
core-2ad0bd0a9b594bbe2560b405b0008b7bc742cfca.zip
logd: Allow (some) headers to be individually importable
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
Diffstat (limited to 'logd')
-rw-r--r--logd/FlushCommand.cpp3
-rw-r--r--logd/LogAudit.cpp5
-rw-r--r--logd/LogAudit.h5
-rw-r--r--logd/LogBufferElement.cpp2
-rw-r--r--logd/LogKlog.cpp3
-rw-r--r--logd/LogKlog.h4
-rw-r--r--logd/LogListener.cpp1
-rw-r--r--logd/LogReader.cpp5
-rw-r--r--logd/LogReader.h4
-rw-r--r--logd/LogTimes.h1
10 files changed, 28 insertions, 5 deletions
diff --git a/logd/FlushCommand.cpp b/logd/FlushCommand.cpp
index fd45c4a0a..6a26d00f3 100644
--- a/logd/FlushCommand.cpp
+++ b/logd/FlushCommand.cpp
@@ -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"
diff --git a/logd/LogAudit.cpp b/logd/LogAudit.cpp
index fffc9ba96..230dd1125 100644
--- a/logd/LogAudit.cpp
+++ b/logd/LogAudit.cpp
@@ -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
diff --git a/logd/LogAudit.h b/logd/LogAudit.h
index 455ed58c0..3a84541a7 100644
--- a/logd/LogAudit.h
+++ b/logd/LogAudit.h
@@ -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;
diff --git a/logd/LogBufferElement.cpp b/logd/LogBufferElement.cpp
index fde9ad7e3..eb5194c6f 100644
--- a/logd/LogBufferElement.cpp
+++ b/logd/LogBufferElement.cpp
@@ -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);
diff --git a/logd/LogKlog.cpp b/logd/LogKlog.cpp
index 9690489ce..ac2b12895 100644
--- a/logd/LogKlog.cpp
+++ b/logd/LogKlog.cpp
@@ -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) \
'<', \
diff --git a/logd/LogKlog.h b/logd/LogKlog.h
index 3c8cc8789..ee73b7187 100644
--- a/logd/LogKlog.h
+++ b/logd/LogKlog.h
@@ -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;
diff --git a/logd/LogListener.cpp b/logd/LogListener.cpp
index 846dd7c41..39dd2272a 100644
--- a/logd/LogListener.cpp
+++ b/logd/LogListener.cpp
@@ -27,6 +27,7 @@
#include <private/android_filesystem_config.h>
#include <private/android_logger.h>
+#include "LogBuffer.h"
#include "LogListener.h"
#include "LogUtils.h"
diff --git a/logd/LogReader.cpp b/logd/LogReader.cpp
index 667a3f249..16362379c 100644
--- a/logd/LogReader.cpp
+++ b/logd/LogReader.cpp
@@ -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),
diff --git a/logd/LogReader.h b/logd/LogReader.h
index 91559a335..174ee651d 100644
--- a/logd/LogReader.h
+++ b/logd/LogReader.h
@@ -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;
diff --git a/logd/LogTimes.h b/logd/LogTimes.h
index 1117088e5..f5969df35 100644
--- a/logd/LogTimes.h
+++ b/logd/LogTimes.h
@@ -27,6 +27,7 @@
#include <log/log.h>
class LogReader;
+class LogBufferElement;
class LogTimeEntry {
static pthread_mutex_t timesLock;