diff options
author | Mark Salyzyn | 2016-03-08 18:18:26 -0600 |
---|---|---|
committer | Mark Salyzyn | 2017-02-08 15:37:44 -0600 |
commit | 96432fc6655fe035d0e66e593ffaf58856e1a826 (patch) | |
tree | 0f987fd49bc00c94f0fb499461aaab09b7c22275 /liblog/config_write.c | |
parent | cf983bcbae801e4660521b9747d9a7516e7df1c1 (diff) | |
download | platform-system-core-96432fc6655fe035d0e66e593ffaf58856e1a826.tar.gz platform-system-core-96432fc6655fe035d0e66e593ffaf58856e1a826.tar.xz platform-system-core-96432fc6655fe035d0e66e593ffaf58856e1a826.zip |
liblog: add __android_log_config_*_close()
Add __android_log_config_read_close() and
__android_log_config_write_close(). Fortify the list macros
to detect for list corruption, looking for entries pointing
to themselves, deleted entries in list.
Test: gTest liblog-unit-tests
Bug: 27405083
Change-Id: I33e8a0cae7e202f1989ddd7c2a96752b44c8e746
Diffstat (limited to 'liblog/config_write.c')
-rw-r--r-- | liblog/config_write.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/liblog/config_write.c b/liblog/config_write.c index d689f631b..0aaaea6e4 100644 --- a/liblog/config_write.c +++ b/liblog/config_write.c | |||
@@ -64,3 +64,17 @@ LIBLOG_HIDDEN void __android_log_config_write() { | |||
64 | __android_log_add_transport(&__android_log_transport_write, &fakeLoggerWrite); | 64 | __android_log_add_transport(&__android_log_transport_write, &fakeLoggerWrite); |
65 | #endif | 65 | #endif |
66 | } | 66 | } |
67 | |||
68 | LIBLOG_HIDDEN void __android_log_config_write_close() { | ||
69 | struct android_log_transport_write *transport; | ||
70 | struct listnode *n; | ||
71 | |||
72 | write_transport_for_each_safe(transport, n, &__android_log_transport_write) { | ||
73 | transport->logMask = 0; | ||
74 | list_remove(&transport->node); | ||
75 | } | ||
76 | write_transport_for_each_safe(transport, n, &__android_log_persist_write) { | ||
77 | transport->logMask = 0; | ||
78 | list_remove(&transport->node); | ||
79 | } | ||
80 | } | ||