Projects
Browse Source     Search     Timeline     Wiki

Changeset 23474

Show
Ignore:
Timestamp:
12/21/07 13:06:36 (12 months ago)
Author:
zarzycki@…
Message:

<rdar://problem/5652211> Bug: launchd_core_logic.c:6375 (23433):0: (target_j = jobmgr_find_by_pid(j->mgr, target_pid, true)) != NULL

Files:
1 modified

Legend:

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

    r23473 r23474  
    406406static void job_log_stray_pg(job_t j); 
    407407static void job_log_chidren_without_exec(job_t j); 
    408 static job_t job_new_anonymous(jobmgr_t jm, pid_t anonpid); 
    409 static job_t job_new(jobmgr_t jm, const char *label, const char *prog, const char *const *argv); 
    410 static job_t job_new_via_mach_init(job_t j, const char *cmd, uid_t uid, bool ond); 
     408static job_t job_new_anonymous(jobmgr_t jm, pid_t anonpid) __attribute__((malloc, nonnull, warn_unused_result)); 
     409static job_t job_new(jobmgr_t jm, const char *label, const char *prog, const char *const *argv) __attribute__((malloc, nonnull(1,2), warn_unused_result)); 
     410static job_t job_new_via_mach_init(job_t j, const char *cmd, uid_t uid, bool ond) __attribute__((malloc, nonnull, warn_unused_result)); 
    411411static const char *job_prog(job_t j); 
    412412static jobmgr_t job_get_bs(job_t j); 
     
    10561056 
    10571057        if (!jobmgr_assumes(jm, anonpid != 0)) { 
     1058                errno = EINVAL; 
    10581059                return NULL; 
    10591060        } 
     
    10611062        if (!jobmgr_assumes(jm, anonpid < 100000)) { 
    10621063                /* The kernel current defines PID_MAX to be 99999, but that define isn't exported */ 
     1064                errno = EINVAL; 
    10631065                return NULL; 
    10641066        } 
     
    10751077 
    10761078        if (!jobmgr_assumes(jm, kp.kp_proc.p_comm[0] != '\0')) { 
     1079                errno = EINVAL; 
    10771080                return NULL; 
    10781081        } 
     
    65036506        } 
    65046507 
     6508        target_j = jobmgr_find_by_pid(j->mgr, target_pid, true); 
     6509 
     6510        if (unlikely(target_j == NULL)) { 
     6511                if (job_assumes(j, errno == ESRCH)) { 
     6512                        job_log(j, LOG_ERR, "Could not find PID %u while trying to set Mach bootstrap service policy: %s", target_pid, target_service); 
     6513                } 
     6514                return BOOTSTRAP_NO_MEMORY; 
     6515        } 
     6516 
    65056517        if (!job_assumes(j, (target_j = jobmgr_find_by_pid(j->mgr, target_pid, true)) != NULL)) { 
    65066518                return BOOTSTRAP_NO_MEMORY;