<!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("DYLD_INSERT_LIBRARIES")) {
+                        setenv("DYLD_INSERT_LIBRARIES", "/usr/lib/libgmalloc.dylib", 1);
+                        setenv("MALLOC_STRICT_SIZE", "1", 1);
+                        execv(argv[0], argv);
+                } else {
+                        unsetenv("DYLD_INSERT_LIBRARIES");
+                        unsetenv("MALLOC_STRICT_SIZE");
+                }
+        }
+#endif
+
</ins><span class="cx">         while ((ch = getopt(argc, argv, "s")) != -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, "unlink(\"%s\"): %m", sockpath);
</del><ins>+                runtime_syslog(LOG_WARNING, "unlink(\"%s\"): %s", sockpath, strerror(errno));
</ins><span class="cx">         } else if (-1 == rmdir(sockdir)) {
</span><del>-                runtime_syslog(LOG_WARNING, "rmdir(\"%s\"): %m", sockdir);
</del><ins>+                runtime_syslog(LOG_WARNING, "rmdir(\"%s\"): %s", 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, &sb);
</span><span class="cx">                                 if (!S_ISDIR(sb.st_mode)) {
</span><span class="cx">                                         errno = EEXIST;
</span><del>-                                        runtime_syslog(LOG_ERR, "mkdir(\"%s\"): %m", LAUNCHD_SOCK_PREFIX);
</del><ins>+                                        runtime_syslog(LOG_ERR, "mkdir(\"%s\"): %s", 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, "mkdir(\"%s\"): %m", ourdir);
</del><ins>+                                runtime_syslog(LOG_ERR, "mkdir(\"%s\"): %s", 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 "launchd-%u.XXXXXX", getpid());
</span><span class="cx">                 if (mkdtemp(ourdir) == NULL) {
</span><del>-                        runtime_syslog(LOG_ERR, "Could not create critical directory \"%s\": %m", ourdir);
</del><ins>+                        runtime_syslog(LOG_ERR, "Could not create critical directory \"%s\": %s", 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), "%s/sock", ourdir);
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx">
</span><span class="cx">         if (unlink(sun.sun_path) == -1 && errno != ENOENT) {
</span><span class="cx">                 if (errno != EROFS) {
</span><del>-                        runtime_syslog(LOG_ERR, "unlink(\"thesocket\"): %m");
</del><ins>+                        runtime_syslog(LOG_ERR, "unlink(\"thesocket\"): %s", 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, "bind(\"thesocket\"): %m");
</del><ins>+                        runtime_syslog(LOG_ERR, "bind(\"thesocket\"): %s", 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, "listen(\"thesocket\"): %m");
</del><ins>+                runtime_syslog(LOG_ERR, "listen(\"thesocket\"): %s", 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, &kqipc_listen_callback) == -1) {
</span><del>-                runtime_syslog(LOG_ERR, "kevent_mod(\"thesocket\", EVFILT_READ): %m");
</del><ins>+                runtime_syslog(LOG_ERR, "kevent_mod(\"thesocket\", EVFILT_READ): %s", 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->filter == EVFILT_READ) {
</span><span class="cx">                 if (launchd_msg_recv(c->conn, ipc_readmsg, c) == -1 && errno != EAGAIN) {
</span><span class="cx">                         if (errno != ECONNRESET) {
</span><del>-                                runtime_syslog(LOG_DEBUG, "%s(): recv: %m", __func__);
</del><ins>+                                runtime_syslog(LOG_DEBUG, "%s(): recv: %s", __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->conn, NULL);
</span><span class="cx">                 if (r == -1) {
</span><span class="cx">                         if (errno != EAGAIN) {
</span><del>-                                runtime_syslog(LOG_DEBUG, "%s(): send: %m", __func__);
</del><ins>+                                runtime_syslog(LOG_DEBUG, "%s(): send: %s", __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->conn), EVFILT_WRITE, EV_ADD, 0, 0, &rmc.c->kqconn_callback);
</span><span class="cx">                 } else {
</span><del>-                        runtime_syslog(LOG_DEBUG, "launchd_msg_send() == -1: %m");
</del><ins>+                        runtime_syslog(LOG_DEBUG, "launchd_msg_send() == -1: %s", 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>