-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
__sigemptyset (&ss->blocked);
__sigemptyset (&ss->pending);
memset (&ss->sigaltstack, 0, sizeof (ss->sigaltstack));
+ ss->sigaltstack.ss_flags |= SS_DISABLE;
ss->preemptors = NULL;
ss->suspended = MACH_PORT_NULL;
ss->intr_port = MACH_PORT_NULL;
struct machine_thread_all_state *state, int *state_change,
void (*reply) (void))
{
+ extern const void _hurd_intr_rpc_msg_about_to;
extern const void _hurd_intr_rpc_msg_in_trap;
mach_port_t rcv_port = MACH_PORT_NULL;
mach_port_t intr_port;
receive completes immediately or aborts. */
abort_thread (ss, state, reply);
- if (state->basic.PC < (natural_t) &_hurd_intr_rpc_msg_in_trap)
+ if (state->basic.PC >= (natural_t) &_hurd_intr_rpc_msg_about_to
+ && state->basic.PC < (natural_t) &_hurd_intr_rpc_msg_in_trap)
{
/* The thread is about to do the RPC, but hasn't yet entered
mach_msg. Mutate the thread's state so it knows not to try
state->basic.SYSRETURN = MACH_SEND_INTERRUPTED;
*state_change = 1;
}
- else if (state->basic.PC == (natural_t) &_hurd_intr_rpc_msg_in_trap &&
+ else if (state->basic.PC == (natural_t) &_hurd_intr_rpc_msg_in_trap
/* The thread was blocked in the system call. After thread_abort,
the return value register indicates what state the RPC was in
when interrupted. */
- state->basic.SYSRETURN == MACH_RCV_INTERRUPTED)
+ && state->basic.SYSRETURN == MACH_RCV_INTERRUPTED)
{
/* The RPC request message was sent and the thread was waiting for
the reply message; now the message receive has been aborted, so
weak_alias (_hurdsig_preemptors, _hurdsig_preempters)
/* Mask of stop signals. */
-#define STOPSIGS (sigmask (SIGTTIN) | sigmask (SIGTTOU) | \
- sigmask (SIGSTOP) | sigmask (SIGTSTP))
+#define STOPSIGS (sigmask (SIGTTIN) | sigmask (SIGTTOU) \
+ | sigmask (SIGSTOP) | sigmask (SIGTSTP))
/* Deliver a signal. SS is not locked. */
void
assert_perror (err);
for (i = 0; i < nthreads; ++i)
{
- if (threads[i] != _hurd_msgport_thread &&
- (act != handle || threads[i] != ss->thread))
+ if (threads[i] != _hurd_msgport_thread
+ && (act != handle || threads[i] != ss->thread))
{
err = __thread_resume (threads[i]);
assert_perror (err);
}
}
- if (_hurd_orphaned && act == stop &&
- (__sigmask (signo) & (__sigmask (SIGTTIN) | __sigmask (SIGTTOU) |
- __sigmask (SIGTSTP))))
+ if (_hurd_orphaned && act == stop
+ && (__sigmask (signo) & (__sigmask (SIGTTIN) | __sigmask (SIGTTOU)
+ | __sigmask (SIGTSTP))))
{
/* If we would ordinarily stop for a job control signal, but we are
orphaned so noone would ever notice and continue us again, we just
}
/* Handle receipt of a blocked signal, or any signal while stopped. */
- if (act != ignore && /* Signals ignored now are forgotten now. */
- __sigismember (&ss->blocked, signo) ||
- (signo != SIGKILL && _hurd_stopped))
+ if (act != ignore /* Signals ignored now are forgotten now. */
+ && __sigismember (&ss->blocked, signo)
+ || (signo != SIGKILL && _hurd_stopped))
{
mark_pending ();
act = ignore;
ref = __mach_reply_port ();
if (! HURD_PORT_USE (&_hurd_ports[INIT_PORT_PROC],
__proc_reauthenticate (port, ref,
- MACH_MSG_TYPE_MAKE_SEND) ||
- __auth_user_authenticate (new, ref,
- MACH_MSG_TYPE_MAKE_SEND,
- &ignore))
+ MACH_MSG_TYPE_MAKE_SEND)
+ || __auth_user_authenticate (new, ref,
+ MACH_MSG_TYPE_MAKE_SEND,
+ &ignore))
&& ignore != MACH_PORT_NULL)
__mach_port_deallocate (__mach_task_self (), ignore);
__mach_port_destroy (__mach_task_self (), ref);