Skip to content

Commit 496cc35

Browse files
committed
Replace another instance of os_log_error
1 parent 11514ea commit 496cc35

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -769,11 +769,17 @@ void internal_join_thread(void *th) { pthread_join((pthread_t)th, 0); }
769769
static Mutex syslog_lock;
770770
# endif
771771

772+
# if SANITIZER_DRIVERKIT
773+
# define SANITIZER_OS_LOG os_log
774+
# else
775+
# define SANITIZER_OS_LOG os_log_error
776+
# endif
777+
772778
void WriteOneLineToSyslog(const char *s) {
773779
#if !SANITIZER_GO
774780
syslog_lock.CheckLocked();
775781
if (GetMacosAlignedVersion() >= MacosVersion(10, 12)) {
776-
os_log_error(OS_LOG_DEFAULT, "%{public}s", s);
782+
SANITIZER_OS_LOG(OS_LOG_DEFAULT, "%{public}s", s);
777783
} else {
778784
#pragma clang diagnostic push
779785
// as_log is deprecated.
@@ -837,12 +843,6 @@ void LogMessageOnPrintf(const char *str) {
837843

838844
void LogFullErrorReport(const char *buffer) {
839845
# if !SANITIZER_GO
840-
# if SANITIZER_DRIVERKIT
841-
# define SANITIZER_OS_LOG os_log
842-
# else
843-
# define SANITIZER_OS_LOG os_log_error
844-
# endif
845-
846846
// Log with os_log.*. This will make it into the crash log.
847847
if (internal_strncmp(SanitizerToolName, "AddressSanitizer",
848848
sizeof("AddressSanitizer") - 1) == 0)
@@ -859,7 +859,6 @@ void LogFullErrorReport(const char *buffer) {
859859

860860
if (common_flags()->log_to_syslog)
861861
SANITIZER_OS_LOG(OS_LOG_DEFAULT, "Consult syslog for more information.");
862-
# undef SANITIZER_OS_LOG
863862

864863
// Log to syslog.
865864
// The logging on OS X may call pthread_create so we need the threading

0 commit comments

Comments
 (0)