Changeset 23553
- Timestamp:
- 03/12/08 15:13:45 (9 months ago)
- Location:
- trunk/launchd/src
- Files:
-
- 2 modified
-
launchd.c (modified) (1 diff)
-
launchd_unix_ipc.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/launchd/src/launchd.c
r23542 r23553 115 115 testfd_or_openfd(STDERR_FILENO, stdouterr_path, O_WRONLY); 116 116 117 #if 0 118 if (pid1_magic) { 119 if (!getenv("DYLD_INSERT_LIBRARIES")) { 120 setenv("DYLD_INSERT_LIBRARIES", "/usr/lib/libgmalloc.dylib", 1); 121 setenv("MALLOC_STRICT_SIZE", "1", 1); 122 execv(argv[0], argv); 123 } else { 124 unsetenv("DYLD_INSERT_LIBRARIES"); 125 unsetenv("MALLOC_STRICT_SIZE"); 126 } 127 } 128 #endif 129 117 130 while ((ch = getopt(argc, argv, "s")) != -1) { 118 131 switch (ch) { -
trunk/launchd/src/launchd_unix_ipc.c
r23481 r23553 82 82 83 83 if (-1 == unlink(sockpath)) { 84 runtime_syslog(LOG_WARNING, "unlink(\"%s\"): % m", sockpath);84 runtime_syslog(LOG_WARNING, "unlink(\"%s\"): %s", sockpath, strerror(errno)); 85 85 } else if (-1 == rmdir(sockdir)) { 86 runtime_syslog(LOG_WARNING, "rmdir(\"%s\"): % m", sockdir);86 runtime_syslog(LOG_WARNING, "rmdir(\"%s\"): %s", sockdir, strerror(errno)); 87 87 } 88 88 } … … 116 116 if (!S_ISDIR(sb.st_mode)) { 117 117 errno = EEXIST; 118 runtime_syslog(LOG_ERR, "mkdir(\"%s\"): % m", LAUNCHD_SOCK_PREFIX);118 runtime_syslog(LOG_ERR, "mkdir(\"%s\"): %s", LAUNCHD_SOCK_PREFIX, strerror(errno)); 119 119 goto out_bad; 120 120 } 121 121 } else { 122 runtime_syslog(LOG_ERR, "mkdir(\"%s\"): % m", ourdir);122 runtime_syslog(LOG_ERR, "mkdir(\"%s\"): %s", ourdir, strerror(errno)); 123 123 goto out_bad; 124 124 } … … 127 127 snprintf(ourdir, sizeof(ourdir), _PATH_TMP "launchd-%u.XXXXXX", getpid()); 128 128 if (mkdtemp(ourdir) == NULL) { 129 runtime_syslog(LOG_ERR, "Could not create critical directory \"%s\": % m", ourdir);129 runtime_syslog(LOG_ERR, "Could not create critical directory \"%s\": %s", ourdir, strerror(errno)); 130 130 goto out_bad; 131 131 } … … 135 135 if (unlink(sun.sun_path) == -1 && errno != ENOENT) { 136 136 if (errno != EROFS) { 137 runtime_syslog(LOG_ERR, "unlink(\"thesocket\"): % m");137 runtime_syslog(LOG_ERR, "unlink(\"thesocket\"): %s", strerror(errno)); 138 138 } 139 139 goto out_bad; … … 150 150 if (r == -1) { 151 151 if (errno != EROFS) { 152 runtime_syslog(LOG_ERR, "bind(\"thesocket\"): % m");152 runtime_syslog(LOG_ERR, "bind(\"thesocket\"): %s", strerror(errno)); 153 153 } 154 154 goto out_bad; … … 156 156 157 157 if (listen(fd, SOMAXCONN) == -1) { 158 runtime_syslog(LOG_ERR, "listen(\"thesocket\"): % m");158 runtime_syslog(LOG_ERR, "listen(\"thesocket\"): %s", strerror(errno)); 159 159 goto out_bad; 160 160 } 161 161 162 162 if (kevent_mod(fd, EVFILT_READ, EV_ADD, 0, 0, &kqipc_listen_callback) == -1) { 163 runtime_syslog(LOG_ERR, "kevent_mod(\"thesocket\", EVFILT_READ): % m");163 runtime_syslog(LOG_ERR, "kevent_mod(\"thesocket\", EVFILT_READ): %s", strerror(errno)); 164 164 goto out_bad; 165 165 } … … 215 215 if (launchd_msg_recv(c->conn, ipc_readmsg, c) == -1 && errno != EAGAIN) { 216 216 if (errno != ECONNRESET) { 217 runtime_syslog(LOG_DEBUG, "%s(): recv: % m", __func__);217 runtime_syslog(LOG_DEBUG, "%s(): recv: %s", __func__, strerror(errno)); 218 218 } 219 219 ipc_close(c); … … 223 223 if (r == -1) { 224 224 if (errno != EAGAIN) { 225 runtime_syslog(LOG_DEBUG, "%s(): send: % m", __func__);225 runtime_syslog(LOG_DEBUG, "%s(): send: %s", __func__, strerror(errno)); 226 226 ipc_close(c); 227 227 } … … 324 324 kevent_mod(launchd_getfd(rmc.c->conn), EVFILT_WRITE, EV_ADD, 0, 0, &rmc.c->kqconn_callback); 325 325 } else { 326 runtime_syslog(LOG_DEBUG, "launchd_msg_send() == -1: % m");326 runtime_syslog(LOG_DEBUG, "launchd_msg_send() == -1: %s", strerror(errno)); 327 327 ipc_close(rmc.c); 328 328 }

