summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2016-03-08 18:18:26 -0600
committerMark Salyzyn2017-02-08 15:37:44 -0600
commit96432fc6655fe035d0e66e593ffaf58856e1a826 (patch)
tree0f987fd49bc00c94f0fb499461aaab09b7c22275 /liblog/config_write.h
parentcf983bcbae801e4660521b9747d9a7516e7df1c1 (diff)
downloadplatform-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.h')
-rw-r--r--liblog/config_write.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/liblog/config_write.h b/liblog/config_write.h
index 3b01a9a80..882541130 100644
--- a/liblog/config_write.h
+++ b/liblog/config_write.h
@@ -29,21 +29,30 @@ extern LIBLOG_HIDDEN struct listnode __android_log_persist_write;
29#define write_transport_for_each(transp, transports) \ 29#define write_transport_for_each(transp, transports) \
30 for ((transp) = node_to_item((transports)->next, \ 30 for ((transp) = node_to_item((transports)->next, \
31 struct android_log_transport_write, node); \ 31 struct android_log_transport_write, node); \
32 ((transp) != node_to_item(transports, \ 32 ((transp) != node_to_item((transports), \
33 struct android_log_transport_write, node)); \ 33 struct android_log_transport_write, \
34 node)) && \
35 ((transp) != node_to_item((transp)->node.next, \
36 struct android_log_transport_write, \
37 node)); \
34 (transp) = node_to_item((transp)->node.next, \ 38 (transp) = node_to_item((transp)->node.next, \
35 struct android_log_transport_write, node)) \ 39 struct android_log_transport_write, node))
36 40
37#define write_transport_for_each_safe(transp, n, transports) \ 41#define write_transport_for_each_safe(transp, n, transports) \
38 for ((transp) = node_to_item((transports)->next, \ 42 for ((transp) = node_to_item((transports)->next, \
39 struct android_log_transport_write, node), \ 43 struct android_log_transport_write, node), \
40 (n) = (transp)->node.next; \ 44 (n) = (transp)->node.next; \
41 ((transp) != node_to_item(transports, \ 45 ((transp) != node_to_item((transports), \
42 struct android_log_transport_write, node)); \ 46 struct android_log_transport_write, \
43 (transp) = node_to_item(n, struct android_log_transport_write, node), \ 47 node)) && \
48 ((transp) != node_to_item((n), struct android_log_transport_write, \
49 node)); \
50 (transp) = node_to_item((n), struct android_log_transport_write, \
51 node), \
44 (n) = (transp)->node.next) 52 (n) = (transp)->node.next)
45 53
46LIBLOG_HIDDEN void __android_log_config_write(); 54LIBLOG_HIDDEN void __android_log_config_write();
55LIBLOG_HIDDEN void __android_log_config_write_close();
47 56
48__END_DECLS 57__END_DECLS
49 58