<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre, #msg p { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[23553] trunk/launchd/src</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.macosforge.org/projects/launchd/changeset/23553">23553</a></dd>
<dt>Author</dt> <dd>zarzycki@apple.com</dd>
<dt>Date</dt> <dd>2008-03-12 15:13:45 -0700 (Wed, 12 Mar 2008)</dd>
</dl>

<h3>Log Message</h3>
<pre>Misc.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunklaunchdsrclaunchdc">trunk/launchd/src/launchd.c</a></li>
<li><a href="#trunklaunchdsrclaunchd_unix_ipcc">trunk/launchd/src/launchd_unix_ipc.c</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunklaunchdsrclaunchdc"></a>
<div class="modfile"><h4>Modified: trunk/launchd/src/launchd.c (23552 => 23553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/launchd/src/launchd.c        2008-03-12 22:13:32 UTC (rev 23552)
+++ trunk/launchd/src/launchd.c        2008-03-12 22:13:45 UTC (rev 23553)
</span><span class="lines">@@ -114,6 +114,19 @@
</span><span class="cx">         testfd_or_openfd(STDOUT_FILENO, stdouterr_path, O_WRONLY);
</span><span class="cx">         testfd_or_openfd(STDERR_FILENO, stdouterr_path, O_WRONLY);
</span><span class="cx"> 
</span><ins>+#if 0
+        if (pid1_magic) {
+                if (!getenv(&quot;DYLD_INSERT_LIBRARIES&quot;)) {
+                        setenv(&quot;DYLD_INSERT_LIBRARIES&quot;, &quot;/usr/lib/libgmalloc.dylib&quot;, 1);
+                        setenv(&quot;MALLOC_STRICT_SIZE&quot;, &quot;1&quot;, 1);
+                        execv(argv[0], argv);
+                } else {
+                        unsetenv(&quot;DYLD_INSERT_LIBRARIES&quot;);
+                        unsetenv(&quot;MALLOC_STRICT_SIZE&quot;);
+                }
+        }
+#endif
+
</ins><span class="cx">         while ((ch = getopt(argc, argv, &quot;s&quot;)) != -1) {
</span><span class="cx">                 switch (ch) {
</span><span class="cx">                 case 's': sflag = true; break;        /* single user */
</span></span></pre></div>
<a id="trunklaunchdsrclaunchd_unix_ipcc"></a>
<div class="modfile"><h4>Modified: trunk/launchd/src/launchd_unix_ipc.c (23552 => 23553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/launchd/src/launchd_unix_ipc.c        2008-03-12 22:13:32 UTC (rev 23552)
+++ trunk/launchd/src/launchd_unix_ipc.c        2008-03-12 22:13:45 UTC (rev 23553)
</span><span class="lines">@@ -81,9 +81,9 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (-1 == unlink(sockpath)) {
</span><del>-                runtime_syslog(LOG_WARNING, &quot;unlink(\&quot;%s\&quot;): %m&quot;, sockpath);
</del><ins>+                runtime_syslog(LOG_WARNING, &quot;unlink(\&quot;%s\&quot;): %s&quot;, sockpath, strerror(errno));
</ins><span class="cx">         } else if (-1 == rmdir(sockdir)) {
</span><del>-                runtime_syslog(LOG_WARNING, &quot;rmdir(\&quot;%s\&quot;): %m&quot;, sockdir);
</del><ins>+                runtime_syslog(LOG_WARNING, &quot;rmdir(\&quot;%s\&quot;): %s&quot;, sockdir, strerror(errno));
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -115,18 +115,18 @@
</span><span class="cx">                                 stat(ourdir, &amp;sb);
</span><span class="cx">                                 if (!S_ISDIR(sb.st_mode)) {
</span><span class="cx">                                         errno = EEXIST;
</span><del>-                                        runtime_syslog(LOG_ERR, &quot;mkdir(\&quot;%s\&quot;): %m&quot;, LAUNCHD_SOCK_PREFIX);
</del><ins>+                                        runtime_syslog(LOG_ERR, &quot;mkdir(\&quot;%s\&quot;): %s&quot;, LAUNCHD_SOCK_PREFIX, strerror(errno));
</ins><span class="cx">                                         goto out_bad;
</span><span class="cx">                                 }
</span><span class="cx">                         } else {
</span><del>-                                runtime_syslog(LOG_ERR, &quot;mkdir(\&quot;%s\&quot;): %m&quot;, ourdir);
</del><ins>+                                runtime_syslog(LOG_ERR, &quot;mkdir(\&quot;%s\&quot;): %s&quot;, ourdir, strerror(errno));
</ins><span class="cx">                                 goto out_bad;
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">         } else {
</span><span class="cx">                 snprintf(ourdir, sizeof(ourdir), _PATH_TMP &quot;launchd-%u.XXXXXX&quot;, getpid());
</span><span class="cx">                 if (mkdtemp(ourdir) == NULL) {
</span><del>-                        runtime_syslog(LOG_ERR, &quot;Could not create critical directory \&quot;%s\&quot;: %m&quot;, ourdir);
</del><ins>+                        runtime_syslog(LOG_ERR, &quot;Could not create critical directory \&quot;%s\&quot;: %s&quot;, ourdir, strerror(errno));
</ins><span class="cx">                         goto out_bad;
</span><span class="cx">                 }
</span><span class="cx">                 snprintf(sun.sun_path, sizeof(sun.sun_path), &quot;%s/sock&quot;, ourdir);
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx"> 
</span><span class="cx">         if (unlink(sun.sun_path) == -1 &amp;&amp; errno != ENOENT) {
</span><span class="cx">                 if (errno != EROFS) {
</span><del>-                        runtime_syslog(LOG_ERR, &quot;unlink(\&quot;thesocket\&quot;): %m&quot;);
</del><ins>+                        runtime_syslog(LOG_ERR, &quot;unlink(\&quot;thesocket\&quot;): %s&quot;, strerror(errno));
</ins><span class="cx">                 }
</span><span class="cx">                 goto out_bad;
</span><span class="cx">         }
</span><span class="lines">@@ -149,18 +149,18 @@
</span><span class="cx"> 
</span><span class="cx">         if (r == -1) {
</span><span class="cx">                 if (errno != EROFS) {
</span><del>-                        runtime_syslog(LOG_ERR, &quot;bind(\&quot;thesocket\&quot;): %m&quot;);
</del><ins>+                        runtime_syslog(LOG_ERR, &quot;bind(\&quot;thesocket\&quot;): %s&quot;, strerror(errno));
</ins><span class="cx">                 }
</span><span class="cx">                 goto out_bad;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (listen(fd, SOMAXCONN) == -1) {
</span><del>-                runtime_syslog(LOG_ERR, &quot;listen(\&quot;thesocket\&quot;): %m&quot;);
</del><ins>+                runtime_syslog(LOG_ERR, &quot;listen(\&quot;thesocket\&quot;): %s&quot;, strerror(errno));
</ins><span class="cx">                 goto out_bad;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (kevent_mod(fd, EVFILT_READ, EV_ADD, 0, 0, &amp;kqipc_listen_callback) == -1) {
</span><del>-                runtime_syslog(LOG_ERR, &quot;kevent_mod(\&quot;thesocket\&quot;, EVFILT_READ): %m&quot;);
</del><ins>+                runtime_syslog(LOG_ERR, &quot;kevent_mod(\&quot;thesocket\&quot;, EVFILT_READ): %s&quot;, strerror(errno));
</ins><span class="cx">                 goto out_bad;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -214,7 +214,7 @@
</span><span class="cx">         if (kev-&gt;filter == EVFILT_READ) {
</span><span class="cx">                 if (launchd_msg_recv(c-&gt;conn, ipc_readmsg, c) == -1 &amp;&amp; errno != EAGAIN) {
</span><span class="cx">                         if (errno != ECONNRESET) {
</span><del>-                                runtime_syslog(LOG_DEBUG, &quot;%s(): recv: %m&quot;, __func__);
</del><ins>+                                runtime_syslog(LOG_DEBUG, &quot;%s(): recv: %s&quot;, __func__, strerror(errno));
</ins><span class="cx">                         }
</span><span class="cx">                         ipc_close(c);
</span><span class="cx">                 }
</span><span class="lines">@@ -222,7 +222,7 @@
</span><span class="cx">                 r = launchd_msg_send(c-&gt;conn, NULL);
</span><span class="cx">                 if (r == -1) {
</span><span class="cx">                         if (errno != EAGAIN) {
</span><del>-                                runtime_syslog(LOG_DEBUG, &quot;%s(): send: %m&quot;, __func__);
</del><ins>+                                runtime_syslog(LOG_DEBUG, &quot;%s(): send: %s&quot;, __func__, strerror(errno));
</ins><span class="cx">                                 ipc_close(c);
</span><span class="cx">                         }
</span><span class="cx">                 } else if (r == 0) {
</span><span class="lines">@@ -323,7 +323,7 @@
</span><span class="cx">                 if (errno == EAGAIN) {
</span><span class="cx">                         kevent_mod(launchd_getfd(rmc.c-&gt;conn), EVFILT_WRITE, EV_ADD, 0, 0, &amp;rmc.c-&gt;kqconn_callback);
</span><span class="cx">                 } else {
</span><del>-                        runtime_syslog(LOG_DEBUG, &quot;launchd_msg_send() == -1: %m&quot;);
</del><ins>+                        runtime_syslog(LOG_DEBUG, &quot;launchd_msg_send() == -1: %s&quot;, strerror(errno));
</ins><span class="cx">                         ipc_close(rmc.c);
</span><span class="cx">                 }
</span><span class="cx">         }
</span></span></pre>
</div>
</div>

</body>
</html>