[launchd-changes] [22990] trunk/launchd/src/launchd_core_logic.c

source_changes at macosforge.org source_changes at macosforge.org
Mon Dec 18 14:30:29 PST 2006


Revision: 22990
          http://trac.macosforge.org/projects/launchd/changeset/22990
Author:   zarzycki at apple.com
Date:     2006-12-18 14:30:29 -0800 (Mon, 18 Dec 2006)

Log Message:
-----------
<rdar://problem/4881060> Pro Tools LE 7.3 fails to launch on Leopard9A322

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

Modified: trunk/launchd/src/launchd_core_logic.c
===================================================================
--- trunk/launchd/src/launchd_core_logic.c	2006-12-15 22:12:46 UTC (rev 22989)
+++ trunk/launchd/src/launchd_core_logic.c	2006-12-18 22:30:29 UTC (rev 22990)
@@ -2219,7 +2219,9 @@
 job_logv(job_t j, int pri, int err, const char *msg, va_list ap)
 {
 	char newmsg[10000];
+	char *newlabel;
 	int oldmask = 0;
+	size_t i, o, jlabel_len = strlen(j->label);
 
 	/*
 	 * Hack: If bootstrap_port is set, we must be on the child side of a
@@ -2230,10 +2232,21 @@
 		return _vproc_logv(pri, err, msg, ap);
 	}
 
+	newlabel = alloca((jlabel_len + 1) * 2);
+
+	for (i = 0, o = 0; i < jlabel_len; i++, o++) {
+		if (j->label[i] == '%') {
+			newlabel[o] = '%';
+			o++;
+		}
+		newlabel[o] = j->label[i];
+	}
+	newlabel[o] = '\0';
+
 	if (err) {
-		snprintf(newmsg, sizeof(newmsg), "%s: %s: %s", j->label, msg, strerror(err));
+		snprintf(newmsg, sizeof(newmsg), "%s: %s: %s", newlabel, msg, strerror(err));
 	} else {
-		snprintf(newmsg, sizeof(newmsg), "%s: %s", j->label, msg);
+		snprintf(newmsg, sizeof(newmsg), "%s: %s", newlabel, msg);
 	}
 
 	if (j->debug) {

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


More information about the launchd-changes mailing list