Projects
Browse Source     Search     Timeline     Wiki

Changeset 23525

Show
Ignore:
Timestamp:
2008-02-26 13:39:33 (8 months ago)
Author:
zarzycki@…
Message:

<rdar://problem/5741980> 10A14 vs. 10A12: 3-4 sec boot time regression (launchd)

Location:
trunk/launchd/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/launchd/src/launchctl.c

    r23517 r23525  
    153153static bool job_disabled_logic(launch_data_t obj); 
    154154static void fix_bogus_file_metadata(void); 
     155static void do_file_init(void) __attribute__((constructor)); 
    155156 
    156157typedef enum { 
     
    221222static bool verbose; 
    222223static bool is_managed; 
     224static bool do_apple_internal_magic; 
    223225 
    224226int 
     
    14821484        assumes(load_and_unload_cmd(4, load_launchd_items) == 0); 
    14831485 
    1484 #ifdef __ppc__ 
    14851486        /* 
    14861487         * 5066316 
     
    15251526         * 
    15261527         */ 
    1527         mach_timespec_t w = { 5, 0 }; 
    1528         IOKitWaitQuiet(kIOMasterPortDefault, &w); 
    1529 #endif 
     1528        if (!do_apple_internal_magic) { 
     1529                mach_timespec_t w = { 5, 0 }; 
     1530                IOKitWaitQuiet(kIOMasterPortDefault, &w); 
     1531        } 
    15301532 
    15311533        do_BootCache_magic(BOOTCACHE_TAG); 
     
    31833185        } 
    31843186} 
     3187 
     3188void 
     3189do_file_init(void) 
     3190{ 
     3191        struct stat sb; 
     3192 
     3193        if (stat("/AppleInternal", &sb) == 0) { 
     3194                do_apple_internal_magic = true; 
     3195        } 
     3196} 
  • trunk/launchd/src/launchd_core_logic.c

    r23519 r23525  
    40294029        struct stat sb; 
    40304030        bool good_exit = (WIFEXITED(j->last_exit_status) && WEXITSTATUS(j->last_exit_status) == 0); 
    4031  
    4032 #ifdef __ppc__ 
     4031        bool is_not_kextd = (do_apple_internal_logging || (strcmp(j->label, "com.apple.kextd") != 0)); 
     4032 
    40334033        /* 
    40344034         * 5066316 
     
    40374037         * launchctl.c for the other half of this hack. 
    40384038         */ 
    4039         if (unlikely(j->mgr->global_on_demand_cnt > 0 && strcmp(j->label, "com.apple.kextd") != 0)) { 
     4039        if (unlikely(j->mgr->global_on_demand_cnt > 0 && is_not_kextd)) { 
    40404040                return false; 
    40414041        } 
    4042 #else 
    4043         if (unlikely(j->mgr->global_on_demand_cnt > 0)) { 
    4044                 return false; 
    4045         } 
    4046 #endif 
    40474042 
    40484043        if (j->start_pending) {