diff options
Diffstat (limited to 'hurd')
-rw-r--r-- | hurd/hurdfault.c | 45 | ||||
-rw-r--r-- | hurd/hurdsig.c | 38 |
2 files changed, 42 insertions, 41 deletions
diff --git a/hurd/hurdfault.c b/hurd/hurdfault.c index e8b54660b9..e1f8c19acc 100644 --- a/hurd/hurdfault.c +++ b/hurd/hurdfault.c @@ -1,5 +1,5 @@ /* Handle faults in the signal thread. -Copyright (C) 1994 Free Software Foundation, Inc. +Copyright (C) 1994, 1995 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -114,30 +114,33 @@ _hurdsig_fault_init (void) struct machine_thread_state state; mach_port_t sigexc; - if (err = __mach_port_allocate (__mach_task_self (), - MACH_PORT_RIGHT_RECEIVE, &sigexc)) - __libc_fatal ("hurd: Can't create receive right for signal thread exc\n"); - if (err = __mach_port_allocate (__mach_task_self (), - MACH_PORT_RIGHT_RECEIVE, &forward_sigexc)) - __libc_fatal ("hurd: Can't create receive right for signal thread exc\n"); + err = __mach_port_allocate (__mach_task_self (), + MACH_PORT_RIGHT_RECEIVE, &sigexc); + assert_perror (err); + err = __mach_port_allocate (__mach_task_self (), + MACH_PORT_RIGHT_RECEIVE, &forward_sigexc); + assert_perror (err); + + err = __mach_port_insert_right (__mach_task_self (), + sigexc, MACH_MSG_TYPE_MAKE_SEND); + assert_perror (err); + err = __thread_set_special_port (_hurd_msgport_thread, + THREAD_EXCEPTION_PORT, sigexc); + __mach_port_deallocate (__mach_task_self (), sigexc); + assert_perror (err); memset (&state, 0, sizeof state); MACHINE_THREAD_STATE_SET_PC (&state, faulted); MACHINE_THREAD_STATE_SET_SP (&state, faultstack, sizeof faultstack); -#if 0 /* Don't confuse gdb. */ - __thread_set_special_port (_hurd_msgport_thread, - THREAD_EXCEPTION_PORT, sigexc); -#endif - - if (err = __USEPORT - (PROC, - __proc_handle_exceptions (port, - sigexc, - forward_sigexc, MACH_MSG_TYPE_MAKE_SEND, - MACHINE_THREAD_STATE_FLAVOR, - (natural_t *) &state, - MACHINE_THREAD_STATE_COUNT))) - __libc_fatal ("hurd: proc won't handle signal thread exceptions\n"); + err = __USEPORT + (PROC, + __proc_handle_exceptions (port, + sigexc, + forward_sigexc, MACH_MSG_TYPE_MAKE_SEND, + MACHINE_THREAD_STATE_FLAVOR, + (natural_t *) &state, + MACHINE_THREAD_STATE_COUNT)); + assert_perror (err); } diff --git a/hurd/hurdsig.c b/hurd/hurdsig.c index 68be2e9bd0..13ffb71822 100644 --- a/hurd/hurdsig.c +++ b/hurd/hurdsig.c @@ -1113,17 +1113,17 @@ _hurdsig_init (void) __mutex_init (&_hurd_siglock); - if (err = __mach_port_allocate (__mach_task_self (), - MACH_PORT_RIGHT_RECEIVE, - &_hurd_msgport)) - __libc_fatal ("hurd: Can't create message port receive right\n"); + err = __mach_port_allocate (__mach_task_self (), + MACH_PORT_RIGHT_RECEIVE, + &_hurd_msgport); + assert_perror (err); /* Make a send right to the signal port. */ - if (err = __mach_port_insert_right (__mach_task_self (), - _hurd_msgport, - _hurd_msgport, - MACH_MSG_TYPE_MAKE_SEND)) - __libc_fatal ("hurd: Can't create send right to message port\n"); + err = __mach_port_insert_right (__mach_task_self (), + _hurd_msgport, + _hurd_msgport, + MACH_MSG_TYPE_MAKE_SEND); + assert_perror (err); /* Set the default thread to receive task-global signals to this one, the main (first) user thread. */ @@ -1131,15 +1131,15 @@ _hurdsig_init (void) /* Start the signal thread listening on the message port. */ - if (err = __thread_create (__mach_task_self (), &_hurd_msgport_thread)) - __libc_fatal ("hurd: Can't create signal thread\n"); + err = __thread_create (__mach_task_self (), &_hurd_msgport_thread); + assert_perror (err); stacksize = __vm_page_size * 4; /* Small stack for signal thread. */ - if (err = __mach_setup_thread (__mach_task_self (), _hurd_msgport_thread, - _hurd_msgport_receive, - (vm_address_t *) &__hurd_sigthread_stack_base, - &stacksize)) - __libc_fatal ("hurd: Can't setup signal thread\n"); + err = __mach_setup_thread (__mach_task_self (), _hurd_msgport_thread, + _hurd_msgport_receive, + (vm_address_t *) &__hurd_sigthread_stack_base, + &stacksize); + assert_perror (err); __hurd_sigthread_stack_end = __hurd_sigthread_stack_base + stacksize; __hurd_sigthread_variables = @@ -1151,14 +1151,12 @@ _hurdsig_init (void) variable for the cached reply port. */ __mig_init ((void *) __hurd_sigthread_stack_base); - if (err = __thread_resume (_hurd_msgport_thread)) - __libc_fatal ("hurd: Can't resume signal thread\n"); + err = __thread_resume (_hurd_msgport_thread); + assert_perror (err); -#if 0 /* Don't confuse poor gdb. */ /* Receive exceptions on the signal port. */ __task_set_special_port (__mach_task_self (), TASK_EXCEPTION_PORT, _hurd_msgport); -#endif } /* XXXX */ /* Reauthenticate with the proc server. */ |