[launchd-changes] [23553] trunk/launchd/src
source_changes at macosforge.org
source_changes at macosforge.org
Wed Mar 12 15:13:45 PDT 2008
Revision: 23553
http://trac.macosforge.org/projects/launchd/changeset/23553
Author: zarzycki at apple.com
Date: 2008-03-12 15:13:45 -0700 (Wed, 12 Mar 2008)
Log Message:
-----------
Misc.
Modified Paths:
--------------
trunk/launchd/src/launchd.c
trunk/launchd/src/launchd_unix_ipc.c
Modified: trunk/launchd/src/launchd.c
===================================================================
--- 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)
@@ -114,6 +114,19 @@
testfd_or_openfd(STDOUT_FILENO, stdouterr_path, O_WRONLY);
testfd_or_openfd(STDERR_FILENO, stdouterr_path, O_WRONLY);
+#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
+
while ((ch = getopt(argc, argv, "s")) != -1) {
switch (ch) {
case 's': sflag = true; break; /* single user */
Modified: trunk/launchd/src/launchd_unix_ipc.c
===================================================================
--- 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)
@@ -81,9 +81,9 @@
}
if (-1 == unlink(sockpath)) {
- runtime_syslog(LOG_WARNING, "unlink(\"%s\"): %m", sockpath);
+ runtime_syslog(LOG_WARNING, "unlink(\"%s\"): %s", sockpath, strerror(errno));
} else if (-1 == rmdir(sockdir)) {
- runtime_syslog(LOG_WARNING, "rmdir(\"%s\"): %m", sockdir);
+ runtime_syslog(LOG_WARNING, "rmdir(\"%s\"): %s", sockdir, strerror(errno));
}
}
@@ -115,18 +115,18 @@
stat(ourdir, &sb);
if (!S_ISDIR(sb.st_mode)) {
errno = EEXIST;
- runtime_syslog(LOG_ERR, "mkdir(\"%s\"): %m", LAUNCHD_SOCK_PREFIX);
+ runtime_syslog(LOG_ERR, "mkdir(\"%s\"): %s", LAUNCHD_SOCK_PREFIX, strerror(errno));
goto out_bad;
}
} else {
- runtime_syslog(LOG_ERR, "mkdir(\"%s\"): %m", ourdir);
+ runtime_syslog(LOG_ERR, "mkdir(\"%s\"): %s", ourdir, strerror(errno));
goto out_bad;
}
}
} else {
snprintf(ourdir, sizeof(ourdir), _PATH_TMP "launchd-%u.XXXXXX", getpid());
if (mkdtemp(ourdir) == NULL) {
- runtime_syslog(LOG_ERR, "Could not create critical directory \"%s\": %m", ourdir);
+ runtime_syslog(LOG_ERR, "Could not create critical directory \"%s\": %s", ourdir, strerror(errno));
goto out_bad;
}
snprintf(sun.sun_path, sizeof(sun.sun_path), "%s/sock", ourdir);
@@ -134,7 +134,7 @@
if (unlink(sun.sun_path) == -1 && errno != ENOENT) {
if (errno != EROFS) {
- runtime_syslog(LOG_ERR, "unlink(\"thesocket\"): %m");
+ runtime_syslog(LOG_ERR, "unlink(\"thesocket\"): %s", strerror(errno));
}
goto out_bad;
}
@@ -149,18 +149,18 @@
if (r == -1) {
if (errno != EROFS) {
- runtime_syslog(LOG_ERR, "bind(\"thesocket\"): %m");
+ runtime_syslog(LOG_ERR, "bind(\"thesocket\"): %s", strerror(errno));
}
goto out_bad;
}
if (listen(fd, SOMAXCONN) == -1) {
- runtime_syslog(LOG_ERR, "listen(\"thesocket\"): %m");
+ runtime_syslog(LOG_ERR, "listen(\"thesocket\"): %s", strerror(errno));
goto out_bad;
}
if (kevent_mod(fd, EVFILT_READ, EV_ADD, 0, 0, &kqipc_listen_callback) == -1) {
- runtime_syslog(LOG_ERR, "kevent_mod(\"thesocket\", EVFILT_READ): %m");
+ runtime_syslog(LOG_ERR, "kevent_mod(\"thesocket\", EVFILT_READ): %s", strerror(errno));
goto out_bad;
}
@@ -214,7 +214,7 @@
if (kev->filter == EVFILT_READ) {
if (launchd_msg_recv(c->conn, ipc_readmsg, c) == -1 && errno != EAGAIN) {
if (errno != ECONNRESET) {
- runtime_syslog(LOG_DEBUG, "%s(): recv: %m", __func__);
+ runtime_syslog(LOG_DEBUG, "%s(): recv: %s", __func__, strerror(errno));
}
ipc_close(c);
}
@@ -222,7 +222,7 @@
r = launchd_msg_send(c->conn, NULL);
if (r == -1) {
if (errno != EAGAIN) {
- runtime_syslog(LOG_DEBUG, "%s(): send: %m", __func__);
+ runtime_syslog(LOG_DEBUG, "%s(): send: %s", __func__, strerror(errno));
ipc_close(c);
}
} else if (r == 0) {
@@ -323,7 +323,7 @@
if (errno == EAGAIN) {
kevent_mod(launchd_getfd(rmc.c->conn), EVFILT_WRITE, EV_ADD, 0, 0, &rmc.c->kqconn_callback);
} else {
- runtime_syslog(LOG_DEBUG, "launchd_msg_send() == -1: %m");
+ runtime_syslog(LOG_DEBUG, "launchd_msg_send() == -1: %s", strerror(errno));
ipc_close(rmc.c);
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080312/ee47a4fc/attachment-0001.html
More information about the launchd-changes
mailing list