summaryrefslogtreecommitdiffstats
path: root/liblog
diff options
context:
space:
mode:
authorMark Salyzyn2017-03-08 17:03:20 -0600
committerMark Salyzyn2017-03-09 11:36:34 -0600
commit04bbc8ea4584b14c21e0c63f8dc4c6b4beb7bd47 (patch)
treee906eca16f222fc43c8a0e848bc3fdda0461560b /liblog
parent2ed51d708eda64516ec79ac6397f690de38f0075 (diff)
downloadplatform-system-core-04bbc8ea4584b14c21e0c63f8dc4c6b4beb7bd47.tar.gz
platform-system-core-04bbc8ea4584b14c21e0c63f8dc4c6b4beb7bd47.tar.xz
platform-system-core-04bbc8ea4584b14c21e0c63f8dc4c6b4beb7bd47.zip
liblog: stay away from C++ keyword private
Replace with void* private with priv in context structure. SideEffects: None Test: gTest liblog-unit-tests Bug: 27405083 Change-Id: I670cb0b7fb2f3085ea13b4ac836d84239a3c8572
Diffstat (limited to 'liblog')
-rw-r--r--liblog/fake_writer.c2
-rw-r--r--liblog/local_logger.c2
-rw-r--r--liblog/logger.h2
-rw-r--r--liblog/stderr_write.c12
4 files changed, 9 insertions, 9 deletions
diff --git a/liblog/fake_writer.c b/liblog/fake_writer.c
index c280e3f49..969661ada 100644
--- a/liblog/fake_writer.c
+++ b/liblog/fake_writer.c
@@ -34,7 +34,7 @@ static int logFds[(int)LOG_ID_MAX] = { -1, -1, -1, -1, -1, -1 };
34 34
35LIBLOG_HIDDEN struct android_log_transport_write fakeLoggerWrite = { 35LIBLOG_HIDDEN struct android_log_transport_write fakeLoggerWrite = {
36 .node = { &fakeLoggerWrite.node, &fakeLoggerWrite.node }, 36 .node = { &fakeLoggerWrite.node, &fakeLoggerWrite.node },
37 .context.private = &logFds, 37 .context.priv = &logFds,
38 .name = "fake", 38 .name = "fake",
39 .available = NULL, 39 .available = NULL,
40 .open = fakeOpen, 40 .open = fakeOpen,
diff --git a/liblog/local_logger.c b/liblog/local_logger.c
index 758905fd4..9906eb724 100644
--- a/liblog/local_logger.c
+++ b/liblog/local_logger.c
@@ -47,7 +47,7 @@ static int writeToLocalWrite(log_id_t logId, struct timespec* ts,
47 47
48LIBLOG_HIDDEN struct android_log_transport_write localLoggerWrite = { 48LIBLOG_HIDDEN struct android_log_transport_write localLoggerWrite = {
49 .node = { &localLoggerWrite.node, &localLoggerWrite.node }, 49 .node = { &localLoggerWrite.node, &localLoggerWrite.node },
50 .context.private = NULL, 50 .context.priv = NULL,
51 .name = "local", 51 .name = "local",
52 .available = writeToLocalAvailable, 52 .available = writeToLocalAvailable,
53 .open = writeToLocalInit, 53 .open = writeToLocalInit,
diff --git a/liblog/logger.h b/liblog/logger.h
index 86c75f8b8..1a39ec092 100644
--- a/liblog/logger.h
+++ b/liblog/logger.h
@@ -30,7 +30,7 @@ __BEGIN_DECLS
30 30
31/* Union, sock or fd of zero is not allowed unless static initialized */ 31/* Union, sock or fd of zero is not allowed unless static initialized */
32union android_log_context { 32union android_log_context {
33 void* private; 33 void* priv;
34 atomic_int sock; 34 atomic_int sock;
35 atomic_int fd; 35 atomic_int fd;
36 struct listnode* node; 36 struct listnode* node;
diff --git a/liblog/stderr_write.c b/liblog/stderr_write.c
index 291ce9322..dbe5309da 100644
--- a/liblog/stderr_write.c
+++ b/liblog/stderr_write.c
@@ -57,7 +57,7 @@ struct stderrContext {
57 57
58LIBLOG_HIDDEN struct android_log_transport_write stderrLoggerWrite = { 58LIBLOG_HIDDEN struct android_log_transport_write stderrLoggerWrite = {
59 .node = { &stderrLoggerWrite.node, &stderrLoggerWrite.node }, 59 .node = { &stderrLoggerWrite.node, &stderrLoggerWrite.node },
60 .context.private = NULL, 60 .context.priv = NULL,
61 .name = "stderr", 61 .name = "stderr",
62 .available = stderrAvailable, 62 .available = stderrAvailable,
63 .open = stderrOpen, 63 .open = stderrOpen,
@@ -74,7 +74,7 @@ static int stderrOpen() {
74 return -EBADF; 74 return -EBADF;
75 } 75 }
76 76
77 if (stderrLoggerWrite.context.private) { 77 if (stderrLoggerWrite.context.priv) {
78 return fileno(stderr); 78 return fileno(stderr);
79 } 79 }
80 80
@@ -117,16 +117,16 @@ static int stderrOpen() {
117 if (envStr) { 117 if (envStr) {
118 android_log_addFilterString(ctx->logformat, envStr); 118 android_log_addFilterString(ctx->logformat, envStr);
119 } 119 }
120 stderrLoggerWrite.context.private = ctx; 120 stderrLoggerWrite.context.priv = ctx;
121 121
122 return fileno(stderr); 122 return fileno(stderr);
123} 123}
124 124
125static void stderrClose() { 125static void stderrClose() {
126 struct stderrContext* ctx = stderrLoggerWrite.context.private; 126 struct stderrContext* ctx = stderrLoggerWrite.context.priv;
127 127
128 if (ctx) { 128 if (ctx) {
129 stderrLoggerWrite.context.private = NULL; 129 stderrLoggerWrite.context.priv = NULL;
130 if (ctx->logformat) { 130 if (ctx->logformat) {
131 android_log_format_free(ctx->logformat); 131 android_log_format_free(ctx->logformat);
132 ctx->logformat = NULL; 132 ctx->logformat = NULL;
@@ -154,7 +154,7 @@ static int stderrWrite(log_id_t logId, struct timespec* ts, struct iovec* vec,
154 char binaryMsgBuf[1024]; 154 char binaryMsgBuf[1024];
155 int err; 155 int err;
156 size_t i; 156 size_t i;
157 struct stderrContext* ctx = stderrLoggerWrite.context.private; 157 struct stderrContext* ctx = stderrLoggerWrite.context.priv;
158 158
159 if (!ctx) return -EBADF; 159 if (!ctx) return -EBADF;
160 if (!vec || !nr) return -EINVAL; 160 if (!vec || !nr) return -EINVAL;