Projects
Browse Source     Search     Timeline     Wiki

Changeset 23346

Show
Ignore:
Timestamp:
08/24/07 14:31:24 (16 months ago)
Author:
zarzycki@…
Message:

<rdar://problem/5330262> Cancelled FUS restart kills pre-login launchd agent

Files:
1 modified

Legend:

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

    r23343 r23346  
    56155615 
    56165616        SLIST_FOREACH(jmi, &root_jobmgr->submgrs, sle) { 
    5617                 if (strcasecmp(jmi->name, where) == 0) { 
     5617                if (jmi->shutting_down) { 
     5618                        continue; 
     5619                } else if (strcasecmp(jmi->name, where) == 0) { 
    56185620                        goto jm_found; 
    56195621                } else if (strcasecmp(jmi->name, VPROCMGR_SESSION_BACKGROUND) == 0 && getpid() == 1) { 
     
    57105712                        j->mgr->parentmgr = background_jobmgr; 
    57115713                        SLIST_INSERT_HEAD(&j->mgr->parentmgr->submgrs, j->mgr, sle); 
     5714                } else if (strcmp(session_type, VPROCMGR_SESSION_LOGINWINDOW) == 0) { 
     5715                        jobmgr_t jmi; 
     5716 
     5717                        /* 
     5718                         * 5330262 
     5719                         * 
     5720                         * We're working around LoginWindow and the WindowServer. 
     5721                         * 
     5722                         * In practice, there is only one LoginWindow session.  * Unfortunately, for certain 
     5723                         * scenarios, the WindowServer spawns loginwindow, and in those cases, it frequently 
     5724                         * spawns a replacement loginwindow session before cleaning up the previous one. 
     5725                         * 
     5726                         * We're going to use the creation of a new LoginWindow context as a clue that the 
     5727                         * previous LoginWindow context is on the way out and therefore we should just 
     5728                         * kick-start the shutdown of it. 
     5729                         */ 
     5730 
     5731                        SLIST_FOREACH(jmi, &root_jobmgr->submgrs, sle) { 
     5732                                if (jmi->shutting_down) { 
     5733                                        continue; 
     5734                                } else if (strcasecmp(jmi->name, session_type) == 0) { 
     5735                                        jobmgr_shutdown(jmi); 
     5736                                        break; 
     5737                                } 
     5738                        } 
    57125739                } 
    57135740