diff options
author | Justus Winter <justus@gnupg.org> | 2017-08-11 18:17:44 +0200 |
---|---|---|
committer | Justus Winter <justus@gnupg.org> | 2017-08-11 22:07:11 +0200 |
commit | 9a4ccfcd4d4f10df2af538c489294527fc231128 (patch) | |
tree | 07cbcc7ac454efd99609c2a60e7e0f8f475ae00c /startup | |
parent | 01ced1f5856659f4f457f39c270dd10f64ccaab8 (diff) | |
download | hurd-9a4ccfcd4d4f10df2af538c489294527fc231128.tar.gz hurd-9a4ccfcd4d4f10df2af538c489294527fc231128.tar.bz2 hurd-9a4ccfcd4d4f10df2af538c489294527fc231128.zip |
startup: Improve error handling.
* startup/startup.c (main): Improve error handling.
Diffstat (limited to 'startup')
-rw-r--r-- | startup/startup.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/startup/startup.c b/startup/startup.c index c76c8304..109ed486 100644 --- a/startup/startup.c +++ b/startup/startup.c @@ -674,7 +674,7 @@ parse_opt (int key, char *arg, struct argp_state *state) int main (int argc, char **argv, char **envp) { - volatile int err; + error_t err; int i; int flags; mach_port_t consdev; @@ -702,8 +702,6 @@ main (int argc, char **argv, char **envp) || device_open (device_master, D_READ|D_WRITE, "console", &consdev)) crash_mach (); - wire_task_self (); - /* Clear our bootstrap port so our children don't inherit it. */ task_set_bootstrap_port (mach_task_self (), MACH_PORT_NULL); @@ -713,6 +711,10 @@ main (int argc, char **argv, char **envp) crash_mach (); setbuf (stdout, NULL); + err = wire_task_self (); + if (err) + error (0, err, "wire_task_self"); + err = argz_create (envp, &startup_envz, &startup_envz_len); assert_perror_backtrace (err); |