* @APPLE_APACHE_LICENSE_HEADER_END@
*/
-static const char *const __rcs_file_version__ = "$Revision: 24003 $";
+static const char *const __rcs_file_version__ = "$Revision: 24498 $";
#include "config.h"
#include "launchd_core_logic.h"
}
if (jobmgr_assumes(jm, (jr = job_new(jm, AUTO_PICK_ANONYMOUS_LABEL, kp.kp_proc.p_comm, NULL)) != NULL)) {
- u_int proc_fflags = NOTE_EXEC|NOTE_FORK|NOTE_EXIT|NOTE_REAP;
+ u_int proc_fflags = NOTE_EXEC|NOTE_FORK|NOTE_EXIT;
total_anon_children++;
jr->anonymous = true;
LIST_REMOVE(spi, sle);
free(spi);
}
-
+
+ j->last_exit_status = status;
struct waiting_for_exit *w4e = NULL;
while( (w4e = LIST_FIRST(&j->exit_watchers)) ) {
waiting4exit_delete(j, w4e);
} else if (!j->anonymous && !j->hopefully_exits_last) {
j->mgr->normal_active_cnt--;
}
- j->last_exit_status = status;
j->sent_signal_time = 0;
j->sent_sigkill = false;
j->clean_kill = false;
j = NULL;
}
}
-
- if (j && (fflags & NOTE_REAP)) {
- job_assumes(j, j->p == 0);
- }
}
void
char nbuf[64];
pid_t c;
bool sipc = false;
- u_int proc_fflags = NOTE_EXIT|NOTE_FORK|NOTE_EXEC|NOTE_REAP;
+ u_int proc_fflags = NOTE_EXIT|NOTE_FORK|NOTE_EXEC;
if (!job_assumes(j, j->mgr != NULL)) {
return;
kern_return_t
job_mig_switch_to_session(job_t j, mach_port_t requestor_port, name_t session_name, mach_port_t audit_session, mach_port_t *new_bsport)
{
+ struct ldcred *ldc = runtime_get_caller_creds();
+ if (!jobmgr_assumes(root_jobmgr, j != NULL)) {
+ jobmgr_log(root_jobmgr, LOG_ERR, "%s() called with NULL job: PID %d", __func__, ldc->pid);
+ return BOOTSTRAP_NO_MEMORY;
+ }
+
job_log(j, LOG_DEBUG, "Job wants to move to %s session.", session_name);
if( !job_assumes(j, pid1_magic == false) ) {