[launchd-changes] [23158] trunk/launchd/src

source_changes at macosforge.org source_changes at macosforge.org
Tue Mar 20 09:07:48 PDT 2007


Revision: 23158
          http://trac.macosforge.org/projects/launchd/changeset/23158
Author:   zarzycki at apple.com
Date:     2007-03-20 09:07:47 -0700 (Tue, 20 Mar 2007)

Log Message:
-----------
<rdar://problem/5072002> Regression: launch_data_dict_lookup() no longer returns NULL outside of launchd

Modified Paths:
--------------
    trunk/launchd/src/launchd_core_logic.c
    trunk/launchd/src/launchd_core_logic.h
    trunk/launchd/src/launchd_unix_ipc.c

Modified: trunk/launchd/src/launchd_core_logic.c
===================================================================
--- trunk/launchd/src/launchd_core_logic.c	2007-03-20 01:28:18 UTC (rev 23157)
+++ trunk/launchd/src/launchd_core_logic.c	2007-03-20 16:07:47 UTC (rev 23158)
@@ -315,7 +315,6 @@
 static void job_callback_proc(job_t j, int flags, int fflags);
 static void job_callback_timer(job_t j, void *ident);
 static void job_callback_read(job_t j, int ident);
-static launch_data_t job_export2(job_t j, bool subjobs);
 static job_t job_new(jobmgr_t jm, const char *label, const char *prog, const char *const *argv);
 static job_t job_new_spawn(job_t j, const char *label, const char *path, const char *workingdir, const char *const *argv, const char *const *env, mode_t *u_mask, bool w4d);
 static job_t job_new_via_mach_init(job_t j, const char *cmd, uid_t uid, bool ond);
@@ -431,12 +430,6 @@
 launch_data_t
 job_export(job_t j)
 {
-	return job_export2(j, true);
-}
-
-launch_data_t
-job_export2(job_t j, bool subjobs)
-{
 	launch_data_t tmp, tmp2, tmp3, r = launch_data_alloc(LAUNCH_DATA_DICTIONARY);
 
 	if (r == NULL) {
@@ -1631,7 +1624,7 @@
 	SLIST_FOREACH(ji, &jm->jobs, sle) {
 		launch_data_t tmp;
 
-		if (jobmgr_assumes(jm, (tmp = job_export2(ji, false)) != NULL)) {
+		if (jobmgr_assumes(jm, (tmp = job_export(ji)) != NULL)) {
 			launch_data_dict_insert(where, tmp, ji->label);
 		}
 	}
@@ -3808,6 +3801,12 @@
 	return NULL;
 }
 
+bool
+job_is_anonymous(job_t j)
+{
+	return j->anonymous;
+}
+
 pid_t
 job_get_pid(job_t j)
 {

Modified: trunk/launchd/src/launchd_core_logic.h
===================================================================
--- trunk/launchd/src/launchd_core_logic.h	2007-03-20 01:28:18 UTC (rev 23157)
+++ trunk/launchd/src/launchd_core_logic.h	2007-03-20 16:07:47 UTC (rev 23158)
@@ -41,6 +41,7 @@
 
 job_t job_dispatch(job_t j, bool kickstart); /* returns j on success, NULL on job removal */
 bool job_active(job_t j);
+bool job_is_anonymous(job_t j);
 launch_data_t job_export(job_t j);
 void job_stop(job_t j);
 void job_checkin(job_t j);

Modified: trunk/launchd/src/launchd_unix_ipc.c
===================================================================
--- trunk/launchd/src/launchd_unix_ipc.c	2007-03-20 01:28:18 UTC (rev 23157)
+++ trunk/launchd/src/launchd_unix_ipc.c	2007-03-20 16:07:47 UTC (rev 23158)
@@ -344,7 +344,7 @@
 
 	if (data == NULL) {
 		if (!strcmp(cmd, LAUNCH_KEY_CHECKIN)) {
-			if (rmc->c->j) {
+			if (!job_is_anonymous(rmc->c->j)) {
 				resp = job_export(rmc->c->j);
 				job_checkin(rmc->c->j);
 			} else {

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20070320/eb949890/attachment.html


More information about the launchd-changes mailing list