From 15d86b03f7cbb54d2ca0e4c0ef9ed26542aa8a3a Mon Sep 17 00:00:00 2001 From: Apple Date: Tue, 8 Nov 2016 04:00:09 +0000 Subject: [PATCH] syslog-349.50.5.tar.gz --- libsystem_asl.tproj/include/asl_private.h | 4 +++- libsystem_asl.tproj/src/asl.c | 11 ++++++----- syslogd.tproj/syslogd.c | 16 ---------------- 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/libsystem_asl.tproj/include/asl_private.h b/libsystem_asl.tproj/include/asl_private.h index e30569d..8235216 100644 --- a/libsystem_asl.tproj/include/asl_private.h +++ b/libsystem_asl.tproj/include/asl_private.h @@ -63,9 +63,11 @@ #define ASL_KEY_FREE_NOTE "ASLFreeNotify" #define ASL_KEY_MESSAGETRACER "com.apple.message.domain" #define ASL_KEY_POWERMANAGEMENT "com.apple.iokit.domain" -#define ASL_KEY_LASTLOG "com.apple.system.lastlog" #define ASL_KEY_CFLOG_LOCAL_TIME "CFLog Local Time" +#define FACILITY_LASTLOG "com.apple.system.lastlog" +#define FACILITY_UTMPX "com.apple.system.utmpx" + /* remote control bits */ #define EVAL_LEVEL_MASK 0x000000ff #define EVAL_ACTION_MASK 0xffff0000 diff --git a/libsystem_asl.tproj/src/asl.c b/libsystem_asl.tproj/src/asl.c index 7248d17..78a48bc 100644 --- a/libsystem_asl.tproj/src/asl.c +++ b/libsystem_asl.tproj/src/asl.c @@ -561,7 +561,8 @@ _asl_evaluate_send(asl_object_t client, asl_object_t m, int slevel) /* don't send lastlog/utmp messages to Activity Tracing */ val = NULL; - if ((asl_msg_lookup(msg, ASL_KEY_FACILITY, &val, NULL) == 0) && (val != NULL) && (!strcmp(val, ASL_KEY_LASTLOG))) eval &= ~EVAL_SEND_TRACE; + if ((asl_msg_lookup(msg, ASL_KEY_FACILITY, &val, NULL) == 0) && (val != NULL) && + (!strcmp(val, FACILITY_LASTLOG) || !strcmp(val, FACILITY_UTMPX))) eval &= ~EVAL_SEND_TRACE; /* don't send CFLog messages to Activity Tracing */ val = NULL; @@ -1021,8 +1022,7 @@ asl_base_msg(asl_client_t *asl, uint32_t level, const struct timeval *tv, const char aux_val[64]; asl_msg_t *aux; int status; - unsigned int osacount = 1; - os_activity_t osaid = 0; + os_activity_id_t osaid; aux = asl_msg_new(ASL_TYPE_MSG); if (aux == NULL) return NULL; @@ -1048,9 +1048,10 @@ asl_base_msg(asl_client_t *asl, uint32_t level, const struct timeval *tv, const asl_msg_set_key_val(aux, ASL_KEY_PID, aux_val); /* OSActivityID */ - if (os_activity_get_active(&osaid, &osacount) == 1) + osaid = os_activity_get_identifier(OS_ACTIVITY_CURRENT, NULL); + if (osaid) { - snprintf(aux_val, sizeof(aux_val), "0x%016llx", (uint64_t)osaid); + snprintf(aux_val, sizeof(aux_val), "0x%016llx", osaid); asl_msg_set_key_val(aux, ASL_KEY_OS_ACTIVITY_ID, aux_val); } diff --git a/syslogd.tproj/syslogd.c b/syslogd.tproj/syslogd.c index e929e9d..8198474 100644 --- a/syslogd.tproj/syslogd.c +++ b/syslogd.tproj/syslogd.c @@ -48,7 +48,6 @@ #include #include #include -#include #include #include @@ -67,8 +66,6 @@ #define NOTIFY_DELAY 1 -#define forever for(;;) - extern int _malloc_no_asl_log; #if TARGET_IPHONE_SIMULATOR @@ -743,19 +740,6 @@ main(int argc, const char *argv[]) dispatch_resume(global.mark_timer); } -#if !TARGET_IPHONE_SIMULATOR - asldebug("starting launchd input channel\n"); - /* - * Start launchd service - * This pins a thread in _vprocmgr_log_drain. Eventually we will either - * remove the whole stderr/stdout -> ASL mechanism entirely, or come up - * with a communication channel that we can trigger with a dispatch source. - */ - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - forever _vprocmgr_log_drain(NULL, NULL, launchd_callback); - }); -#endif - asldebug("starting mach service\n"); /* * Start mach server -- 2.45.2