/[hurd]/hurd/init/init.c
ViewVC logotype

Diff of /hurd/init/init.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.127 by roland, Wed Jan 2 11:21:41 2002 UTC revision 1.128 by neal, Tue Mar 26 19:05:56 2002 UTC
# Line 171  reboot_mach (int flags) Line 171  reboot_mach (int flags)
171      }      }
172    else    else
173      {      {
174          error_t err;
175        printf ("%s: %sing Mach (flags %#x)...\n",        printf ("%s: %sing Mach (flags %#x)...\n",
176                program_invocation_short_name, BOOT (flags), flags);                program_invocation_short_name, BOOT (flags), flags);
177        fflush (stdout);        fflush (stdout);
178        sleep (5);        sleep (5);
179        while ((errno = host_reboot (host_priv, flags)))        while ((err = host_reboot (host_priv, flags)))
180          error (0, errno, "reboot");          error (0, err, "reboot");
181        for (;;);        for (;;);
182      }      }
183  }  }
# Line 357  run (const char *server, mach_port_t *po Line 358  run (const char *server, mach_port_t *po
358    while (1)    while (1)
359      {      {
360        file_t file;        file_t file;
361          error_t err;
362    
363        file = file_name_lookup (prog, O_EXEC, 0);        file = file_name_lookup (prog, O_EXEC, 0);
364        if (file == MACH_PORT_NULL)        if (file == MACH_PORT_NULL)
# Line 373  run (const char *server, mach_port_t *po Line 375  run (const char *server, mach_port_t *po
375                printf ("Pausing for %s\n", prog);                printf ("Pausing for %s\n", prog);
376                getchar ();                getchar ();
377              }              }
378            errno = file_exec (file, *task, 0,            err = file_exec (file, *task, 0,
379                               (char *)prog, strlen (prog) + 1, /* Args.  */                             (char *)prog, strlen (prog) + 1, /* Args.  */
380                               startup_envz, startup_envz_len,                             startup_envz, startup_envz_len,
381                               default_dtable, MACH_MSG_TYPE_COPY_SEND, 3,                             default_dtable, MACH_MSG_TYPE_COPY_SEND, 3,
382                               ports, MACH_MSG_TYPE_COPY_SEND, INIT_PORT_MAX,                             ports, MACH_MSG_TYPE_COPY_SEND, INIT_PORT_MAX,
383                               default_ints, INIT_INT_MAX,                             default_ints, INIT_INT_MAX,
384                               NULL, 0, NULL, 0);                             NULL, 0, NULL, 0);
385            if (!errno)            if (!err)
386              break;              break;
387    
388            error (0, errno, "%s", prog);            error (0, err, "%s", prog);
389          }          }
390    
391        printf ("File name for server %s (or nothing to reboot): ", server);        printf ("File name for server %s (or nothing to reboot): ", server);
# Line 426  run_for_real (char *filename, char *args Line 428  run_for_real (char *filename, char *args
428        if (getstring (buf, sizeof (buf)) && *buf)        if (getstring (buf, sizeof (buf)) && *buf)
429          filename = buf;          filename = buf;
430        file = file_name_lookup (filename, O_EXEC, 0);        file = file_name_lookup (filename, O_EXEC, 0);
431        if (!file)        if (file == MACH_PORT_NULL)
432          error (0, errno, "%s", filename);          error (0, errno, "%s", filename);
433      }      }
434    while (!file);    while (file == MACH_PORT_NULL);
435  #else  #else
436    file = file_name_lookup (filename, O_EXEC, 0);    file = file_name_lookup (filename, O_EXEC, 0);
437    if (!file)    if (file == MACH_PORT_NULL)
438      {      {
439        error (0, errno, "%s", filename);        error (0, errno, "%s", filename);
440        return 0;        return 0;
# Line 692  launch_core_servers (void) Line 694  launch_core_servers (void)
694      mach_port_deallocate (mach_task_self (), old);      mach_port_deallocate (mach_task_self (), old);
695    
696    /* Give the bootstrap FS its proc and auth ports.  */    /* Give the bootstrap FS its proc and auth ports.  */
697    errno = fsys_init (bootport, fsproc, MACH_MSG_TYPE_COPY_SEND, authserver);    err = fsys_init (bootport, fsproc, MACH_MSG_TYPE_COPY_SEND, authserver);
698    mach_port_deallocate (mach_task_self (), fsproc);    mach_port_deallocate (mach_task_self (), fsproc);
699    if (errno)    if (err)
700      error (0, errno, "fsys_init"); /* Not necessarily fatal.  */      error (0, err, "fsys_init"); /* Not necessarily fatal.  */
701  }  }
702    
703  /* Set up the initial value of the standard exec data. */  /* Set up the initial value of the standard exec data. */
# Line 1029  start_child (const char *prog, char **pr Line 1031  start_child (const char *prog, char **pr
1031    assert_perror (err);    assert_perror (err);
1032    
1033    file = file_name_lookup (args, O_EXEC, 0);    file = file_name_lookup (args, O_EXEC, 0);
1034    if (!file)    if (file == MACH_PORT_NULL)
1035      {      {
1036        error (0, errno, "%s", args);        error (0, errno, "%s", args);
1037        free (args);        free (args);

Legend:
Removed from v.1.127  
changed lines
  Added in v.1.128

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26