Changeset 23219
- Timestamp:
- 04/12/07 14:35:37 (21 months ago)
- Files:
-
- 1 modified
-
trunk/launchd/src/launchd_core_logic.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/launchd/src/launchd_core_logic.c
r23218 r23219 372 372 static void job_log_error(job_t j, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4))); 373 373 static void job_log_bug(job_t j, const char *rcs_rev, const char *path, unsigned int line, const char *test); 374 static void job_set_exeception_port(job_t j, mach_port_t port); 374 375 static kern_return_t job_handle_mpm_wait(job_t j, mach_port_t srp, int *waitstatus); 375 376 … … 3398 3399 #endif 3399 3400 3400 job_assumes(j, task_set_exception_ports(target_task, em, the_exception_server, 3401 EXCEPTION_STATE_IDENTITY | MACH_EXCEPTION_CODES, f) == KERN_SUCCESS); 3402 3401 if (target_task) { 3402 job_assumes(j, task_set_exception_ports(target_task, em, the_exception_server, 3403 EXCEPTION_STATE_IDENTITY | MACH_EXCEPTION_CODES, f) == KERN_SUCCESS); 3404 } else if (getpid() == 1) { 3405 mach_port_t mhp = mach_host_self(); 3406 job_assumes(j, host_set_exception_ports(mhp, em, the_exception_server, 3407 EXCEPTION_STATE_IDENTITY | MACH_EXCEPTION_CODES, f) == KERN_SUCCESS); 3408 job_assumes(j, launchd_mport_deallocate(mhp) == KERN_SUCCESS); 3409 } 3410 3411 } 3412 3413 void 3414 job_set_exeception_port(job_t j, mach_port_t port) 3415 { 3416 if (!the_exception_server) { 3417 the_exception_server = port; 3418 job_setup_exception_port(j, 0); 3419 } else { 3420 job_log(j, LOG_WARNING, "The exception server is already claimed!"); 3421 } 3403 3422 } 3404 3423 … … 3448 3467 ms->hide = b; 3449 3468 } else if (strcasecmp(key, LAUNCH_JOBKEY_MACH_EXCEPTIONSERVER) == 0) { 3450 if (!the_exception_server) { 3451 the_exception_server = ms->port; 3452 } else { 3453 job_log(ms->job, LOG_WARNING, "The exception server is already claimed!"); 3454 } 3469 job_set_exeception_port(ms->job, ms->port); 3455 3470 } else if (strcasecmp(key, LAUNCH_JOBKEY_MACH_KUNCSERVER) == 0) { 3456 3471 ms->kUNCServer = b; … … 3459 3474 break; 3460 3475 case LAUNCH_DATA_DICTIONARY: 3461 if (!the_exception_server) { 3462 the_exception_server = ms->port; 3463 } else { 3464 job_log(ms->job, LOG_WARNING, "The exception server is already claimed!"); 3465 } 3476 job_set_exeception_port(ms->job, ms->port); 3466 3477 break; 3467 3478 default:

