]> git.saurik.com Git - apple/syslog.git/blobdiff - syslogd.tproj/daemon.c
syslog-385.tar.gz
[apple/syslog.git] / syslogd.tproj / daemon.c
index 7cf83d02276b6b02cfc2c02646bdaf5a9cdddddb..edb5dc36b42e1b0771f582d533196cd39b2dff02 100644 (file)
 #include <uuid/uuid.h>
 #include <asl_private.h>
 #include <os/transaction_private.h>
 #include <uuid/uuid.h>
 #include <asl_private.h>
 #include <os/transaction_private.h>
+
 #include "daemon.h"
 
 #include "daemon.h"
 
+
 #define LIST_SIZE_DELTA 256
 #define STATS_TABLE_SIZE 256
 
 #define LIST_SIZE_DELTA 256
 #define STATS_TABLE_SIZE 256
 
@@ -72,7 +74,7 @@ static int name_change_token = -1;
 
 static OSSpinLock count_lock = 0;
 
 
 static OSSpinLock count_lock = 0;
 
-#if !TARGET_OS_EMBEDDED
+#if !(TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR)
 static os_transaction_t main_transaction;
 #endif
 
 static os_transaction_t main_transaction;
 #endif
 
@@ -322,7 +324,7 @@ asl_client_count_increment()
 {
        OSSpinLockLock(&count_lock);
 
 {
        OSSpinLockLock(&count_lock);
 
-#if !TARGET_OS_EMBEDDED
+#if !(TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR)
        if (global.client_count == 0) main_transaction = os_transaction_create("com.apple.syslogd");
 #endif
        global.client_count++;
        if (global.client_count == 0) main_transaction = os_transaction_create("com.apple.syslogd");
 #endif
        global.client_count++;
@@ -336,7 +338,7 @@ asl_client_count_decrement()
        OSSpinLockLock(&count_lock);
 
        if (global.client_count > 0) global.client_count--;
        OSSpinLockLock(&count_lock);
 
        if (global.client_count > 0) global.client_count--;
-#if !TARGET_OS_EMBEDDED
+#if !(TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR)
        if (global.client_count == 0) os_release(main_transaction);
 #endif
 
        if (global.client_count == 0) os_release(main_transaction);
 #endif
 
@@ -655,7 +657,7 @@ init_globals(void)
        global.debug_file = NULL;
        global.launchd_enabled = 1;
 
        global.debug_file = NULL;
        global.launchd_enabled = 1;
 
-#if TARGET_OS_EMBEDDED
+#if (TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR)
        global.dbtype = DB_TYPE_MEMORY;
 #else
        global.dbtype = DB_TYPE_FILE;
        global.dbtype = DB_TYPE_MEMORY;
 #else
        global.dbtype = DB_TYPE_FILE;
@@ -873,7 +875,7 @@ control_set_param(const char *s, bool eval)
                }
                else
                {
                }
                else
                {
-#if TARGET_OS_EMBEDDED
+#if (TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR)
                        intval = DB_TYPE_MEMORY;
 #else
                        intval = DB_TYPE_FILE;
                        intval = DB_TYPE_MEMORY;
 #else
                        intval = DB_TYPE_FILE;
@@ -914,6 +916,7 @@ control_message(asl_msg_t *msg)
        return 0;
 }
 
        return 0;
 }
 
+
 void
 process_message(asl_msg_t *msg, uint32_t source)
 {
 void
 process_message(asl_msg_t *msg, uint32_t source)
 {
@@ -971,6 +974,7 @@ process_message(asl_msg_t *msg, uint32_t source)
                status = aslmsg_verify(msg, source, &kplevel, &uid);
                if (status == VERIFY_STATUS_OK)
                {
                status = aslmsg_verify(msg, source, &kplevel, &uid);
                if (status == VERIFY_STATUS_OK)
                {
+
                        if ((source == SOURCE_KERN) && (kplevel >= 0))
                        {
                                if (kplevel > 7) kplevel = 7;
                        if ((source == SOURCE_KERN) && (kplevel >= 0))
                        {
                                if (kplevel > 7) kplevel = 7;