<!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 { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { 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>[23025] trunk/launchd/src</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.macosforge.org/projects/launchd/changeset/23025">23025</a></dd>
<dt>Author</dt> <dd>zarzycki@apple.com</dd>
<dt>Date</dt> <dd>2007-01-28 13:15:53 -0800 (Sun, 28 Jan 2007)</dd>
</dl>
<h3>Log Message</h3>
<pre>The last remaining customer (loginwindow) of /etc/ttys has switched to launchd.
This is the easy part or removing init.c. The next stage will be to deal with
single-user-mode in launchd proper and clean up launchd's self-bootstrap logic.
Then we can finally delete init.c.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunklaunchdsrcinitc">trunk/launchd/src/init.c</a></li>
<li><a href="#trunklaunchdsrclaunchctl1">trunk/launchd/src/launchctl.1</a></li>
<li><a href="#trunklaunchdsrclaunchctlc">trunk/launchd/src/launchctl.c</a></li>
<li><a href="#trunklaunchdsrclaunchdc">trunk/launchd/src/launchd.c</a></li>
<li><a href="#trunklaunchdsrclaunchdh">trunk/launchd/src/launchd.h</a></li>
<li><a href="#trunklaunchdsrclaunchd_unix_ipcc">trunk/launchd/src/launchd_unix_ipc.c</a></li>
<li><a href="#trunklaunchdsrcliblaunch_privateh">trunk/launchd/src/liblaunch_private.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunklaunchdsrcinitc"></a>
<div class="modfile"><h4>Modified: trunk/launchd/src/init.c (23024 => 23025)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/launchd/src/init.c        2007-01-26 23:45:13 UTC (rev 23024)
+++ trunk/launchd/src/init.c        2007-01-28 21:15:53 UTC (rev 23025)
</span><span class="lines">@@ -55,10 +55,6 @@
</span><span class="cx">
</span><span class="cx"> static const char *const __rcs_file_version__ = "$Revision$";
</span><span class="cx">
</span><del>-#include <Security/Authorization.h>
-#include <Security/AuthorizationTags.h>
-#include <Security/AuthSession.h>
-
</del><span class="cx"> #include <sys/types.h>
</span><span class="cx"> #include <sys/queue.h>
</span><span class="cx"> #include <sys/param.h>
</span><span class="lines">@@ -91,14 +87,7 @@
</span><span class="cx">
</span><span class="cx"> #define _PATH_RUNCOM "/etc/rc"
</span><span class="cx">
</span><del>-/*
- * Sleep times; used to prevent thrashing.
- */
-#define        GETTY_SPACING                 5        /* N secs minimum getty spacing */
-#define        GETTY_SLEEP                30        /* sleep N secs after spacing problem */
</del><span class="cx"> #define        STALL_TIMEOUT                30        /* wait N secs after warning */
</span><del>-#define        DEATH_WATCH                10        /* wait N secs for procs to die */
-#define FAILED_HW_PASS                 5        /* wait N secs before croaking user */
</del><span class="cx">
</span><span class="cx"> static void stall(char *, ...);
</span><span class="cx">
</span><span class="lines">@@ -117,58 +106,8 @@
</span><span class="cx">
</span><span class="cx"> static void setctty(const char *, int);
</span><span class="cx">
</span><del>-// gvdl@next.com 14 Aug 1995
-// - from ~apps/loginwindow_proj/loginwindow/common.h
-#define REALLY_EXIT_TO_CONSOLE 229
-
-// From old init.c
-// These flags are used in the se_flags field of the init_session structure
-#define        SE_SHUTDOWN        0x1                /* session won't be restarted */
-
-// The flags below control what sort of getty is launched.
-#define SE_GETTY_LAUNCH        0x30        /* What type of getty to launch */
-#define SE_COMMON        0x00        /* Usual command that is run - getty */
-#define SE_ONERROR        0x10        /* Command to run if error condition occurs.
-                                 * This will almost always be the windowserver
-                                 * and loginwindow. This is so if the w.s.
-                                 * ever dies, that the naive user (stan)
-                                 * doesn't ever see the console window. */
-#define SE_ONOPTION         0x20        /* Command to run when loginwindow exits with
-                                 * special error code (229). This signifies
-                                 * that the user typed "console" at l.w. and
-                                 * l.w. wants to exit and have init run getty
-                                 * which will then put up a console window. */
-
-typedef struct _se_command {
-        char        *path;                /* what to run on that port */
-        char        **argv;                /* pre-parsed argument array */
-} se_cmd_t;
-
-typedef struct init_session {
-        kq_callback se_callback;        /* run loop callback */
-        int        se_index;                /* index of entry in ttys file */
-        pid_t        se_process;                /* controlling process */
-        time_t        se_started;                /* used to avoid thrashing */
-        int        se_flags;                /* status of session */
-        char        *se_device;                /* filename of port */
-        se_cmd_t se_getty;                /* what to run on that port */
-        se_cmd_t se_onerror;                /* See SE_ONERROR above */
-        se_cmd_t se_onoption;                /* See SE_ONOPTION above */
-        TAILQ_ENTRY(init_session) tqe;
-} *session_t;
-
-static TAILQ_HEAD(sessionshead, init_session) sessions = TAILQ_HEAD_INITIALIZER(sessions);
-
-static void session_new(int, struct ttyent *);
-static void session_free(session_t);
-static void session_launch(session_t);
-static void session_reap(session_t);
-static void session_callback(void *, struct kevent *);
-
-static char **construct_argv(char *);
</del><span class="cx"> static void setsecuritylevel(int);
</span><span class="cx"> static int getsecuritylevel(void);
</span><del>-static int setupargv(session_t, struct ttyent *);
</del><span class="cx"> static bool should_fsck(void);
</span><span class="cx">
</span><span class="cx"> void
</span><span class="lines">@@ -183,8 +122,6 @@
</span><span class="cx"> void
</span><span class="cx"> init_pre_kevent(void)
</span><span class="cx"> {
</span><del>-        session_t s;
-
</del><span class="cx">         if (single_user_pid || runcom_pid)
</span><span class="cx">                 return;
</span><span class="cx">
</span><span class="lines">@@ -200,16 +137,12 @@
</span><span class="cx">          * mode, and the run script has not set a higher level of security
</span><span class="cx">          * than level 1, then put the kernel into secure mode.
</span><span class="cx">          */
</span><del>-        if (getsecuritylevel() == 0)
</del><ins>+        if (getsecuritylevel() == 0) {
</ins><span class="cx">                 setsecuritylevel(1);
</span><del>-
-        TAILQ_FOREACH(s, &sessions, tqe) {
-                if (s->se_process == 0)
-                        session_launch(s);
</del><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void
</del><ins>+void
</ins><span class="cx"> stall(char *message, ...)
</span><span class="cx"> {
</span><span class="cx">         va_list ap;
</span><span class="lines">@@ -220,7 +153,7 @@
</span><span class="cx">         sleep(STALL_TIMEOUT);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static int
</del><ins>+int
</ins><span class="cx"> getsecuritylevel(void)
</span><span class="cx"> {
</span><span class="cx">         int name[2], curlevel;
</span><span class="lines">@@ -236,7 +169,7 @@
</span><span class="cx">         return curlevel;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void
</del><ins>+void
</ins><span class="cx"> setsecuritylevel(int newlevel)
</span><span class="cx"> {
</span><span class="cx">         int name[2], curlevel;
</span><span class="lines">@@ -259,7 +192,7 @@
</span><span class="cx"> * Start a session and allocate a controlling terminal.
</span><span class="cx"> * Only called by children of init after forking.
</span><span class="cx"> */
</span><del>-static void
</del><ins>+void
</ins><span class="cx"> setctty(const char *name, int flags)
</span><span class="cx"> {
</span><span class="cx">         int fd;
</span><span class="lines">@@ -275,7 +208,7 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void
</del><ins>+void
</ins><span class="cx"> single_user(void)
</span><span class="cx"> {
</span><span class="cx">         bool runcom_fsck = should_fsck();
</span><span class="lines">@@ -315,7 +248,7 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void
</del><ins>+void
</ins><span class="cx"> single_user_callback(void *obj __attribute__((unused)), struct kevent *kev __attribute__((unused)))
</span><span class="cx"> {
</span><span class="cx">         int status;
</span><span class="lines">@@ -338,10 +271,11 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static struct timeval runcom_start_tv = { 0, 0 };
</span><ins>+
</ins><span class="cx"> /*
</span><span class="cx"> * Run the system startup script.
</span><span class="cx"> */
</span><del>-static void
</del><ins>+void
</ins><span class="cx"> runcom(void)
</span><span class="cx"> {
</span><span class="cx">         char *argv[] = { "/bin/launchctl", "bootstrap", NULL };
</span><span class="lines">@@ -389,7 +323,7 @@
</span><span class="cx">         exit(EXIT_FAILURE);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void
</del><ins>+void
</ins><span class="cx"> runcom_callback(void *obj __attribute__((unused)), struct kevent *kev __attribute__((unused)))
</span><span class="cx"> {
</span><span class="cx">         int status;
</span><span class="lines">@@ -421,323 +355,9 @@
</span><span class="cx">         single_user_mode = true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-/*
- * Construct an argument vector from a command line.
- */
-char **
-construct_argv(command)
-        char *command;
</del><ins>+bool
+init_check_pid(pid_t p)
</ins><span class="cx"> {
</span><del>-        int argc = 0;
-        char **argv = (char **) malloc(((strlen(command) + 1) / 2 + 1)
-                                                * sizeof (char *));
-        static const char separators[] = " \t";
-
-        if ((argv[argc++] = strtok(command, separators)) == 0)
-                return 0;
-        while ((argv[argc++] = strtok(NULL, separators)))
-                continue;
-        return argv;
-}
-
-/*
- * Deallocate a session descriptor.
- */
-
-static void free_command(se_cmd_t *se_cmd)
-{
- if (se_cmd->path) {
-        free(se_cmd->path);
-        free(se_cmd->argv);
- }
-}
-
-void
-session_free(session_t s)
-{
-        TAILQ_REMOVE(&sessions, s, tqe);
-        if (s->se_process) {
-                if (kevent_mod(s->se_process, EVFILT_PROC, EV_ADD,
-                                        NOTE_EXIT, 0, &kqsimple_zombie_reaper) == -1)
-                        session_reap(s);
-                else
-                        kill(s->se_process, SIGHUP);
-        }
-        free(s->se_device);
-        free_command(&s->se_getty);
-        free_command(&s->se_onerror);
-        free_command(&s->se_onoption);
-        free(s);
-}
-
-static int setup_command(se_cmd_t *se_cmd, char *command, char *arg )
-{
-        char *commandWithArg;
-
-        asprintf(&commandWithArg, "%s %s", command, arg);
-
-        free_command(se_cmd);
-
-        se_cmd->path = commandWithArg;
-        se_cmd->argv = construct_argv(commandWithArg);
-        if (se_cmd->argv == NULL) {
-                free(se_cmd->path);
-                se_cmd->path = NULL;
-                return 0;
-        }
-        return 1;
-}
-
-/*
- * Calculate getty and if useful window argv vectors.
- */
-static int
-setupargv(sp, typ)
-        session_t sp;
-        struct ttyent *typ;
-{
- char *type;
-
- if ( !setup_command(&sp->se_getty, typ->ty_getty, typ->ty_name) )
- {
-        type = "getty";
-        goto bad_args;
- }
-
- if (typ->ty_onerror
- && !setup_command(&sp->se_onerror, typ->ty_onerror, typ->ty_name) )
- {
-        type = "onerror";
-        goto bad_args;
- }
-
- if (typ->ty_onoption
- && !setup_command(&sp->se_onoption, typ->ty_onoption, typ->ty_name) )
- {
-        type = "onoption";
-        goto bad_args;
- }
-
- return 1;
-
-bad_args:
- syslog(LOG_WARNING, "can't parse %s for port %s", type, sp->se_device);
- return 0;
-}
-
-
-/*
- * Allocate a new session descriptor.
- */
-void
-session_new(session_index, typ)
-        int session_index;
-        struct ttyent *typ;
-{
-        session_t s;
-
-        if ((typ->ty_status & TTY_ON) == 0 ||
-         typ->ty_name == 0 ||
-         typ->ty_getty == 0)
-                return;
-
-        s = calloc(1, sizeof(struct init_session));
-
-        s->se_callback = session_callback;
-        s->se_index = session_index;
-
-        TAILQ_INSERT_TAIL(&sessions, s, tqe);
-
-        asprintf(&s->se_device, "%s%s", _PATH_DEV, typ->ty_name);
-
-        if (setupargv(s, typ) == 0)
-                session_free(s);
-}
-
-static void
-session_launch(session_t s)
-{
-        pid_t pid;
-        sigset_t mask;
-        se_cmd_t *se_cmd;
-        const char *session_type = NULL;
-        time_t current_time = time(NULL);
-        bool is_loginwindow = false;
-
-        // Setup the default values;
-        switch (s->se_flags & SE_GETTY_LAUNCH) {
-        case SE_ONOPTION:
-                if (s->se_onoption.path) {
-                        se_cmd = &s->se_onoption;
-                        session_type = "onoption";
-                        break;
-                }
-                /* No break */
-        case SE_ONERROR:
-                if (s->se_onerror.path) {
-                        se_cmd = &s->se_onerror;
-                        session_type = "onerror";
-                        break;
-                }
-                /* No break */
-        case SE_COMMON:
-        default:
-                se_cmd = &s->se_getty;
-                session_type = "getty";
-                break;
-        }
-
-        if (strcmp(se_cmd->argv[0], "/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow") == 0)
-                is_loginwindow = true;
-
-        pid = launchd_fork();
-
-        if (pid == -1) {
-                syslog(LOG_ERR, "can't fork for %s on port %s: %m",
-                                session_type, s->se_device);
-                return;
-        }
-
-        if (pid) {
-                s->se_process = pid;
-                s->se_started = time(NULL);
-                s->se_flags &= ~SE_GETTY_LAUNCH; // clear down getty launch type
-                if (kevent_mod(pid, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, &s->se_callback) == -1)
-                        session_reap(s);
-                return;
-        }
-
-        if (current_time > s->se_started &&
-         current_time - s->se_started < GETTY_SPACING) {
-                syslog(LOG_WARNING, "%s repeating too quickly on port %s, sleeping",
-                 session_type, s->se_device);
-                sleep(GETTY_SLEEP);
-        }
-
-        sigemptyset(&mask);
-        sigprocmask(SIG_SETMASK, &mask, NULL);
-
-
-        if (!is_loginwindow)
-                launchd_SessionCreate();
-
-        execv(se_cmd->argv[0], se_cmd->argv);
-        stall("can't exec %s '%s' for port %s: %m", session_type,
-                se_cmd->argv[0], s->se_device);
-        exit(EXIT_FAILURE);
-}
-
-static void
-session_callback(void *obj, struct kevent *kev __attribute__((unused)))
-{
-        session_t s = obj;
-
-        session_reap(s);
-        if (s->se_flags & SE_SHUTDOWN) {
-                session_free(s);
-        } else {
-                session_launch(s);
-        }
-}
-
-static void
-session_reap(session_t s)
-{
-        char *line;
-        int status;
-
-        if (!launchd_assumes(waitpid(s->se_process, &status, 0) == s->se_process))
-                return;
-
-        if (WIFSIGNALED(status)) {
-                syslog(LOG_WARNING, "%s port %s exited abnormally: %s",
-                                s->se_getty.path, s->se_device, strsignal(WTERMSIG(status)));
-                s->se_flags |= SE_ONERROR;
-        } else if (WEXITSTATUS(status) == REALLY_EXIT_TO_CONSOLE) {
-                /* WIFEXITED(status) assumed */
-                s->se_flags |= SE_ONOPTION;
-        } else {
-                s->se_flags |= SE_ONERROR;
-        }
-
-        s->se_process = 0;
-        line = s->se_device + sizeof(_PATH_DEV) - 1;
-
-        if (logout(line))
-                logwtmp(line, "", "");
-}
-
-/*
- * This is an n-squared algorithm. We hope it isn't run often...
- */
-void
-update_ttys(void)
-{
-        session_t sp;
-        struct ttyent *typ;
-        int session_index = 0;
-        int devlen;
-
-        devlen = sizeof(_PATH_DEV) - 1;
-        while ((typ = getttyent())) {
-                ++session_index;
-
-                TAILQ_FOREACH(sp, &sessions, tqe) {
-                        if (strcmp(typ->ty_name, sp->se_device + devlen) == 0)
-                                break;
-                }
-
-                if (sp == NULL) {
-                        session_new(session_index, typ);
-                        continue;
-                }
-
-                if (sp->se_index != session_index) {
-                        syslog(LOG_INFO, "port %s changed utmp index from %d to %d",
-                         sp->se_device, sp->se_index,
-                         session_index);
-                        sp->se_index = session_index;
-                }
-
-                if ((typ->ty_status & TTY_ON) == 0 ||
-                 typ->ty_getty == 0) {
-                        session_free(sp);
-                        continue;
-                }
-
-                sp->se_flags &= ~SE_SHUTDOWN;
-
-                if (setupargv(sp, typ) == 0) {
-                        syslog(LOG_WARNING, "can't parse getty for port %s",
-                                sp->se_device);
-                        session_free(sp);
-                }
-        }
-
-        endttyent();
-}
-
-/*
- * Block further logins.
- */
-void
-catatonia(void)
-{
-        session_t s;
-
-        TAILQ_FOREACH(s, &sessions, tqe)
-                s->se_flags |= SE_SHUTDOWN;
-}
-
-bool init_check_pid(pid_t p)
-{
-        session_t s;
-
-        TAILQ_FOREACH(s, &sessions, tqe) {
-                if (s->se_process == p)
-                        return true;
-        }
-
</del><span class="cx">         if (single_user_pid == p)
</span><span class="cx">                 return true;
</span><span class="cx">
</span></span></pre></div>
<a id="trunklaunchdsrclaunchctl1"></a>
<div class="modfile"><h4>Modified: trunk/launchd/src/launchctl.1 (23024 => 23025)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/launchd/src/launchctl.1        2007-01-26 23:45:13 UTC (rev 23024)
+++ trunk/launchd/src/launchctl.1        2007-01-28 21:15:53 UTC (rev 23025)
</span><span class="lines">@@ -140,10 +140,6 @@
</span><span class="cx"> Tell
</span><span class="cx"> .Nm launchd
</span><span class="cx"> to prepare for shutdown by removing all jobs.
</span><del>-.It Ar reloadttys
-Tell
-.Nm launchd
-to reread /etc/ttys. This option may go away in a future release.
</del><span class="cx"> .It Ar umask Op Ar newmask
</span><span class="cx"> Get or optionally set the
</span><span class="cx"> .Xr umask 2
</span></span></pre></div>
<a id="trunklaunchdsrclaunchctlc"></a>
<div class="modfile"><h4>Modified: trunk/launchd/src/launchctl.c (23024 => 23025)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/launchd/src/launchctl.c        2007-01-26 23:45:13 UTC (rev 23024)
+++ trunk/launchd/src/launchctl.c        2007-01-28 21:15:53 UTC (rev 23025)
</span><span class="lines">@@ -134,7 +134,6 @@
</span><span class="cx"> static void empty_dir(const char *thedir, struct stat *psb);
</span><span class="cx"> static int touch_file(const char *path, mode_t m);
</span><span class="cx"> static void do_sysversion_sysctl(void);
</span><del>-static void workaround4465949(void);
</del><span class="cx"> static void do_application_firewall_magic(int sfd, launch_data_t thejob);
</span><span class="cx"> static void preheat_page_cache_hack(void);
</span><span class="cx"> static void do_bootroot_magic(void);
</span><span class="lines">@@ -185,7 +184,6 @@
</span><span class="cx">         { "stderr",        stdio_cmd,                "Redirect launchd's standard error to the given path" },
</span><span class="cx">         { "shutdown",        fyi_cmd,                "Prepare for system shutdown" },
</span><span class="cx">         { "singleuser",        fyi_cmd,                "Switch to single-user mode" },
</span><del>-        { "reloadttys",        fyi_cmd,                "Reload /etc/ttys" },
</del><span class="cx">         { "getrusage",        getrusage_cmd,                "Get resource usage statistics from launchd" },
</span><span class="cx">         { "log",        logupdate_cmd,                "Adjust the logging level or mask of launchd" },
</span><span class="cx">         { "umask",        umask_cmd,                "Change launchd's umask" },
</span><span class="lines">@@ -1279,8 +1277,6 @@
</span><span class="cx">         const char *SystemStarter_tool[] = { "SystemStarter", NULL };
</span><span class="cx">         assumes(fwexec(SystemStarter_tool, false) != -1);
</span><span class="cx">
</span><del>-        workaround4465949();
-
</del><span class="cx">         if (path_check("/etc/rc.local")) {
</span><span class="cx">                 const char *rc_local_tool[] = { _PATH_BSHELL, "/etc/rc.local", NULL };
</span><span class="cx">                 assumes(fwexec(rc_local_tool, false) != -1);
</span><span class="lines">@@ -1289,32 +1285,6 @@
</span><span class="cx">         return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void
-workaround4465949(void)
-{
-        const char *pbs_tool[] = { "/System/Library/CoreServices/pbs", NULL };
-        const char *lca_tool[] = { "/System/Library/CoreServices/Language Chooser.app/Contents/MacOS/Language Chooser", NULL};
-        char *const reloadttys_argv[] = { "reloadttys", NULL };
-        int wstatus;
-        pid_t pbs_p;
-
-        if (path_check("/System/Library/LaunchDaemons/com.apple.loginwindow.plist")) {
-                return;
-        }
-
-        if (path_check(pbs_tool[0]) && path_check(lca_tool[0]) &&
-                        !path_check("/var/db/.AppleSetupDone") &&
-                        path_check("/var/db/.RunLanguageChooserToo")) {
-                if (assumes((pbs_p = fwexec(pbs_tool, false)) != -1)) {
-                        assumes(fwexec(lca_tool, true) != -1);
-                        assumes(kill(pbs_p, SIGTERM) != -1);
-                        assumes(waitpid(pbs_p, &wstatus, 0) != -1);
-                }
-        }
-
-        assumes(fyi_cmd(1, reloadttys_argv) == 0);
-}
-
</del><span class="cx"> int
</span><span class="cx"> load_and_unload_cmd(int argc, char *const argv[])
</span><span class="cx"> {
</span><span class="lines">@@ -1763,7 +1733,7 @@
</span><span class="cx"> fyi_cmd(int argc, char *const argv[])
</span><span class="cx"> {
</span><span class="cx">         launch_data_t resp, msg;
</span><del>-        const char *lmsgk = LAUNCH_KEY_RELOADTTYS;
</del><ins>+        const char *lmsgk = NULL;
</ins><span class="cx">         int e, r = 0;
</span><span class="cx">
</span><span class="cx">         if (argc != 1) {
</span><span class="lines">@@ -1775,6 +1745,8 @@
</span><span class="cx">                 lmsgk = LAUNCH_KEY_SHUTDOWN;
</span><span class="cx">         } else if (!strcmp(argv[0], "singleuser")) {
</span><span class="cx">                 lmsgk = LAUNCH_KEY_SINGLEUSER;
</span><ins>+        } else {
+                return 1;
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         msg = launch_data_new_string(lmsgk);
</span></span></pre></div>
<a id="trunklaunchdsrclaunchdc"></a>
<div class="modfile"><h4>Modified: trunk/launchd/src/launchd.c (23024 => 23025)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/launchd/src/launchd.c        2007-01-26 23:45:13 UTC (rev 23024)
+++ trunk/launchd/src/launchd.c        2007-01-28 21:15:53 UTC (rev 23025)
</span><span class="lines">@@ -469,10 +469,6 @@
</span><span class="cx">         rlcj = NULL;
</span><span class="cx">
</span><span class="cx">         jobmgr_remove_all_inactive(root_jobmgr);
</span><del>-
-        if (getpid() == 1) {
-                catatonia();
-        }
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void
</span></span></pre></div>
<a id="trunklaunchdsrclaunchdh"></a>
<div class="modfile"><h4>Modified: trunk/launchd/src/launchd.h (23024 => 23025)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/launchd/src/launchd.h        2007-01-26 23:45:13 UTC (rev 23024)
+++ trunk/launchd/src/launchd.h        2007-01-28 21:15:53 UTC (rev 23025)
</span><span class="lines">@@ -55,9 +55,6 @@
</span><span class="cx"> void init_boot(bool sflag);
</span><span class="cx"> void init_pre_kevent(void);
</span><span class="cx">
</span><del>-void update_ttys(void);
-void catatonia(void);
-
</del><span class="cx"> void mach_start_shutdown(void);
</span><span class="cx"> void mach_init_init(mach_port_t);
</span><span class="cx">
</span></span></pre></div>
<a id="trunklaunchdsrclaunchd_unix_ipcc"></a>
<div class="modfile"><h4>Modified: trunk/launchd/src/launchd_unix_ipc.c (23024 => 23025)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/launchd/src/launchd_unix_ipc.c        2007-01-26 23:45:13 UTC (rev 23024)
+++ trunk/launchd/src/launchd_unix_ipc.c        2007-01-28 21:15:53 UTC (rev 23025)
</span><span class="lines">@@ -352,9 +352,6 @@
</span><span class="cx">                         } else {
</span><span class="cx">                                 resp = launch_data_new_errno(EACCES);
</span><span class="cx">                         }
</span><del>-                } else if (!strcmp(cmd, LAUNCH_KEY_RELOADTTYS)) {
-                        update_ttys();
-                        resp = launch_data_new_errno(0);
</del><span class="cx">                 } else if (!strcmp(cmd, LAUNCH_KEY_SHUTDOWN)) {
</span><span class="cx">                         launchd_shutdown();
</span><span class="cx">                         resp = launch_data_new_errno(0);
</span></span></pre></div>
<a id="trunklaunchdsrcliblaunch_privateh"></a>
<div class="modfile"><h4>Modified: trunk/launchd/src/liblaunch_private.h (23024 => 23025)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/launchd/src/liblaunch_private.h        2007-01-26 23:45:13 UTC (rev 23024)
+++ trunk/launchd/src/liblaunch_private.h        2007-01-28 21:15:53 UTC (rev 23025)
</span><span class="lines">@@ -37,7 +37,6 @@
</span><span class="cx"> #define LAUNCH_KEY_SINGLEUSER                "SingleUser"
</span><span class="cx"> #define LAUNCH_KEY_GETRESOURCELIMITS        "GetResourceLimits"
</span><span class="cx"> #define LAUNCH_KEY_SETRESOURCELIMITS        "SetResourceLimits"
</span><del>-#define LAUNCH_KEY_RELOADTTYS                "ReloadTTYS"
</del><span class="cx"> #define LAUNCH_KEY_SETLOGMASK                "SetLogMask"
</span><span class="cx"> #define LAUNCH_KEY_GETLOGMASK                "GetLogMask"
</span><span class="cx"> #define LAUNCH_KEY_SETUMASK                "SetUmask"
</span></span></pre>
</div>
</div>
</body>
</html>