Projects
Browse Source     Search     Timeline     Wiki

Changeset 23553

Show
Ignore:
Timestamp:
2008-03-12 15:13:45 (6 months ago)
Author:
zarzycki@…
Message:

Misc.

Location:
trunk/launchd/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/launchd/src/launchd.c

    r23542 r23553  
    115115        testfd_or_openfd(STDERR_FILENO, stdouterr_path, O_WRONLY); 
    116116 
     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 
    117130        while ((ch = getopt(argc, argv, "s")) != -1) { 
    118131                switch (ch) { 
  • trunk/launchd/src/launchd_unix_ipc.c

    r23481 r23553  
    8282 
    8383        if (-1 == unlink(sockpath)) { 
    84                 runtime_syslog(LOG_WARNING, "unlink(\"%s\"): %m", sockpath); 
     84                runtime_syslog(LOG_WARNING, "unlink(\"%s\"): %s", sockpath, strerror(errno)); 
    8585        } 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)); 
    8787        } 
    8888} 
     
    116116                                if (!S_ISDIR(sb.st_mode)) { 
    117117                                        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)); 
    119119                                        goto out_bad; 
    120120                                } 
    121121                        } else { 
    122                                 runtime_syslog(LOG_ERR, "mkdir(\"%s\"): %m", ourdir); 
     122                                runtime_syslog(LOG_ERR, "mkdir(\"%s\"): %s", ourdir, strerror(errno)); 
    123123                                goto out_bad; 
    124124                        } 
     
    127127                snprintf(ourdir, sizeof(ourdir), _PATH_TMP "launchd-%u.XXXXXX", getpid()); 
    128128                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)); 
    130130                        goto out_bad; 
    131131                } 
     
    135135        if (unlink(sun.sun_path) == -1 && errno != ENOENT) { 
    136136                if (errno != EROFS) { 
    137                         runtime_syslog(LOG_ERR, "unlink(\"thesocket\"): %m"); 
     137                        runtime_syslog(LOG_ERR, "unlink(\"thesocket\"): %s", strerror(errno)); 
    138138                } 
    139139                goto out_bad; 
     
    150150        if (r == -1) { 
    151151                if (errno != EROFS) { 
    152                         runtime_syslog(LOG_ERR, "bind(\"thesocket\"): %m"); 
     152                        runtime_syslog(LOG_ERR, "bind(\"thesocket\"): %s", strerror(errno)); 
    153153                } 
    154154                goto out_bad; 
     
    156156 
    157157        if (listen(fd, SOMAXCONN) == -1) { 
    158                 runtime_syslog(LOG_ERR, "listen(\"thesocket\"): %m"); 
     158                runtime_syslog(LOG_ERR, "listen(\"thesocket\"): %s", strerror(errno)); 
    159159                goto out_bad; 
    160160        } 
    161161 
    162162        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)); 
    164164                goto out_bad; 
    165165        } 
     
    215215                if (launchd_msg_recv(c->conn, ipc_readmsg, c) == -1 && errno != EAGAIN) { 
    216216                        if (errno != ECONNRESET) { 
    217                                 runtime_syslog(LOG_DEBUG, "%s(): recv: %m", __func__); 
     217                                runtime_syslog(LOG_DEBUG, "%s(): recv: %s", __func__, strerror(errno)); 
    218218                        } 
    219219                        ipc_close(c); 
     
    223223                if (r == -1) { 
    224224                        if (errno != EAGAIN) { 
    225                                 runtime_syslog(LOG_DEBUG, "%s(): send: %m", __func__); 
     225                                runtime_syslog(LOG_DEBUG, "%s(): send: %s", __func__, strerror(errno)); 
    226226                                ipc_close(c); 
    227227                        } 
     
    324324                        kevent_mod(launchd_getfd(rmc.c->conn), EVFILT_WRITE, EV_ADD, 0, 0, &rmc.c->kqconn_callback); 
    325325                } else { 
    326                         runtime_syslog(LOG_DEBUG, "launchd_msg_send() == -1: %m"); 
     326                        runtime_syslog(LOG_DEBUG, "launchd_msg_send() == -1: %s", strerror(errno)); 
    327327                        ipc_close(rmc.c); 
    328328                }