@@ -86,26 +86,6 @@ void *BackgroundThread(void *arg) {
86
86
}
87
87
#endif
88
88
89
- void WriteToSyslog (const char *msg) {
90
- InternalScopedString msg_copy;
91
- msg_copy.append (" %s" , msg);
92
- const char *p = msg_copy.data ();
93
-
94
- // Print one line at a time.
95
- // syslog, at least on Android, has an implicit message length limit.
96
- while (char * q = internal_strchr (p, ' \n ' )) {
97
- *q = ' \0 ' ;
98
- WriteOneLineToSyslog (p);
99
- p = q + 1 ;
100
- }
101
- // Print remaining characters, if there are any.
102
- // Note that this will add an extra newline at the end.
103
- // FIXME: buffer extra output. This would need a thread-local buffer, which
104
- // on Android requires plugging into the tools (ex. ASan's) Thread class.
105
- if (*p)
106
- WriteOneLineToSyslog (p);
107
- }
108
-
109
89
void MaybeStartBackgroudThread () {
110
90
#if (SANITIZER_LINUX || SANITIZER_NETBSD) && \
111
91
!SANITIZER_GO // Need to implement/test on other platforms.
@@ -126,6 +106,26 @@ void MaybeStartBackgroudThread() {
126
106
#endif
127
107
}
128
108
109
+ void WriteToSyslog (const char *msg) {
110
+ InternalScopedString msg_copy;
111
+ msg_copy.append (" %s" , msg);
112
+ const char *p = msg_copy.data ();
113
+
114
+ // Print one line at a time.
115
+ // syslog, at least on Android, has an implicit message length limit.
116
+ while (char * q = internal_strchr (p, ' \n ' )) {
117
+ *q = ' \0 ' ;
118
+ WriteOneLineToSyslog (p);
119
+ p = q + 1 ;
120
+ }
121
+ // Print remaining characters, if there are any.
122
+ // Note that this will add an extra newline at the end.
123
+ // FIXME: buffer extra output. This would need a thread-local buffer, which
124
+ // on Android requires plugging into the tools (ex. ASan's) Thread class.
125
+ if (*p)
126
+ WriteOneLineToSyslog (p);
127
+ }
128
+
129
129
static void (*sandboxing_callback)();
130
130
void SetSandboxingCallback (void (*f)()) {
131
131
sandboxing_callback = f;
0 commit comments