]> git.saurik.com Git - apple/syslog.git/commitdiff
syslog-349.50.5.tar.gz macos-10124 macos-10125 macos-10126 v349.50.5
authorApple <opensource@apple.com>
Tue, 8 Nov 2016 04:00:09 +0000 (04:00 +0000)
committerApple <opensource@apple.com>
Tue, 8 Nov 2016 04:00:09 +0000 (04:00 +0000)
libsystem_asl.tproj/include/asl_private.h
libsystem_asl.tproj/src/asl.c
syslogd.tproj/syslogd.c

index e30569da3185d15ecf03d060fa908886a8269c0d..8235216eccc66a91bc11ab9af170dfe6adaed6ce 100644 (file)
 #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
index 7248d17984f2318076b79bce7da06b08b69cc744..78a48bcddfca8a62f9e908df72fd8c8cd9936f0f 100644 (file)
@@ -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);
        }
 
index e929e9d5c4b890faf7e8af853d0984465a985306..81984746e19213579c7a71610e6f55f19e2c5bc4 100644 (file)
@@ -48,7 +48,6 @@
 #include <notify.h>
 #include <notify_keys.h>
 #include <utmpx.h>
-#include <vproc_priv.h>
 #include <asl_private.h>
 #include <pwd.h>
 
@@ -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