diff options
author | Michael I. Bushnell <mib@gnu.org> | 1994-04-07 19:09:23 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1994-04-07 19:09:23 +0000 |
commit | 9ffcb3eac021a84fd2cbdd1b3b64da99583f4548 (patch) | |
tree | 6cb58c6c4fb93e5ec9b2009f8f24f551084313fa | |
parent | d7721f88bd8ff157bc17188b2de1184651f78ddc (diff) |
Formerly init.c.~12~
-rw-r--r-- | init/init.c | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/init/init.c b/init/init.c index 8e79d3be..14cea39e 100644 --- a/init/init.c +++ b/init/init.c @@ -200,29 +200,35 @@ run_for_real (char *filename) { file_t file; error_t err; - - file = path_lookup (filename, O_EXEC, 0); - if (file == MACH_PORT_NULL) - perror (filename); - else + char buf[512]; + task_t task; + + do { - task_t task; - task_create (mach_task_self (), 0, &task); - proc_child (procserver, task); - proc_task2proc (procserver, task, &default_ports[INIT_PORT_PROC]); - printf ("Pausing for %s\n", filename); - getchar (); - err = file_exec (file, task, 0, - NULL, 0, /* No args. */ - NULL, 0, /* No env. */ - default_dtable, MACH_MSG_TYPE_COPY_SEND, 3, - default_ports, MACH_MSG_TYPE_COPY_SEND, - INIT_PORT_MAX, - NULL, 0, /* No info in init ints. */ - NULL, 0, NULL, 0); - mach_port_deallocate (mach_task_self (), default_ports[INIT_PORT_PROC]); - mach_port_deallocate (mach_task_self (), task); + printf ("File name [%s]: ", filename); + if (getstring (buf, sizeof (buf)) && *buf) + filename = buf; + file = path_lookup (filename, O_EXEC, 0); + if (!file) + perror (filename); } + while (!file); + + task_create (mach_task_self (), 0, &task); + proc_child (procserver, task); + proc_task2proc (procserver, task, &default_ports[INIT_PORT_PROC]); + printf ("Pausing for %s\n", filename); + getchar (); + err = file_exec (file, task, 0, + NULL, 0, /* No args. */ + NULL, 0, /* No env. */ + default_dtable, MACH_MSG_TYPE_COPY_SEND, 3, + default_ports, MACH_MSG_TYPE_COPY_SEND, + INIT_PORT_MAX, + NULL, 0, /* No info in init ints. */ + NULL, 0, NULL, 0); + mach_port_deallocate (mach_task_self (), default_ports[INIT_PORT_PROC]); + mach_port_deallocate (mach_task_self (), task); mach_port_deallocate (mach_task_self (), file); } |