From ecc24ac1bcea4d08a11ebe824d1cd48962a99393 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Fri, 31 Mar 1995 23:21:59 +0000 Subject: Don't deallocate our right to the underlying disk node, so we don't get garbage collected prematurely. Also move the check for the bootstrap port after the args check, so that users can run it from the shell to get a usage message. --- trans/magic.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'trans/magic.c') diff --git a/trans/magic.c b/trans/magic.c index 1bc4fe9a..f55e1bb6 100644 --- a/trans/magic.c +++ b/trans/magic.c @@ -37,10 +37,6 @@ main (int argc, char **argv) error_t err; mach_port_t bootstrap, control, realnode; - task_get_bootstrap_port (mach_task_self (), &bootstrap); - if (bootstrap == MACH_PORT_NULL) - error(3, 0, "Must be started as a translator"); - if (argc != 2 || *argv[1] == '-') { fprintf(stderr, "Usage: %s MAGIC", program_invocation_name); @@ -48,6 +44,10 @@ main (int argc, char **argv) } magic = argv[1]; + + task_get_bootstrap_port (mach_task_self (), &bootstrap); + if (bootstrap == MACH_PORT_NULL) + error(3, 0, "Must be started as a translator"); /* Reply to our parent */ mach_port_allocate (mach_task_self (), MACH_PORT_RIGHT_RECEIVE, &control); @@ -55,8 +55,6 @@ main (int argc, char **argv) if (err) error(1, err, "starting translator"); - mach_port_deallocate (mach_task_self (), realnode); - /* Launch */ while (1) { -- cgit v1.2.3