Changeset 23474
- Timestamp:
- 12/21/07 13:06:36 (12 months ago)
- Files:
-
- 1 modified
-
trunk/launchd/src/launchd_core_logic.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/launchd/src/launchd_core_logic.c
r23473 r23474 406 406 static void job_log_stray_pg(job_t j); 407 407 static 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) ;408 static job_t job_new_anonymous(jobmgr_t jm, pid_t anonpid) __attribute__((malloc, nonnull, warn_unused_result)); 409 static 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)); 410 static job_t job_new_via_mach_init(job_t j, const char *cmd, uid_t uid, bool ond) __attribute__((malloc, nonnull, warn_unused_result)); 411 411 static const char *job_prog(job_t j); 412 412 static jobmgr_t job_get_bs(job_t j); … … 1056 1056 1057 1057 if (!jobmgr_assumes(jm, anonpid != 0)) { 1058 errno = EINVAL; 1058 1059 return NULL; 1059 1060 } … … 1061 1062 if (!jobmgr_assumes(jm, anonpid < 100000)) { 1062 1063 /* The kernel current defines PID_MAX to be 99999, but that define isn't exported */ 1064 errno = EINVAL; 1063 1065 return NULL; 1064 1066 } … … 1075 1077 1076 1078 if (!jobmgr_assumes(jm, kp.kp_proc.p_comm[0] != '\0')) { 1079 errno = EINVAL; 1077 1080 return NULL; 1078 1081 } … … 6503 6506 } 6504 6507 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 6505 6517 if (!job_assumes(j, (target_j = jobmgr_find_by_pid(j->mgr, target_pid, true)) != NULL)) { 6506 6518 return BOOTSTRAP_NO_MEMORY;

