[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/4] lwip: return EINTR when a select() IPC thread is cancell
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 3/4] lwip: return EINTR when a select() IPC thread is cancelled |
Date: |
Tue, 14 Aug 2018 00:36:28 +0200 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
Joan Lledó, le sam. 11 août 2018 18:17:09 +0200, a ecrit:
> Needed to properly support poll in glibc (_hurd_select).
>
> * lwip/io-ops.c (lwip_io_select_common): Detect when the
> current RPC is cancelled by checking the reply port.
Applied, thanks!
> ---
> lwip/io-ops.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/lwip/io-ops.c b/lwip/io-ops.c
> index 1429bc55..72e08e26 100644
> --- a/lwip/io-ops.c
> +++ b/lwip/io-ops.c
> @@ -198,6 +198,8 @@ lwip_io_select_common (struct sock_user *user,
> int timeout;
> struct pollfd fdp;
> nfds_t nfds;
> + mach_port_type_t type;
> + error_t err;
>
> if (!user)
> return EOPNOTSUPP;
> @@ -227,6 +229,12 @@ lwip_io_select_common (struct sock_user *user,
> timeout = tv ? tv->tv_sec * 1000 + tv->tv_nsec / 1000000 : -1;
> ret = lwip_poll (&fdp, nfds, timeout);
>
> + err = mach_port_type (mach_task_self (), reply, &type);
> + if (err || (type & MACH_PORT_TYPE_DEAD_NAME))
> + /* The reply port is dead, we were cancelled */
> + return EINTR;
> +
> +
> if (ret > 0)
> {
> if (fdp.revents & POLLERR)
> --
> 2.11.0
>
>
--
Samuel
<T> l'autre jour j'ai eu un type qu'est venu me demander « J'ai installé le
logiciel comme indiqué sur le site. Puis quand je le lance ça plante et ça me
marque “Voulez-vous envoyez un rapport d'erreur ?”. Je fais quoi ?! »
-+- ... -+-
- Patches: lwip translator, Joan Lledó, 2018/08/07
- [PATCH 1/4] lwip: select/poll(): return EIO when POLLERR is set, Joan Lledó, 2018/08/07
- [PATCH 3/4] lwip: return EINTR when a select() IPC thread is cancelled, Joan Lledó, 2018/08/07
- [PATCH 2/4] lwip: refactor main demuxer to avoid code duplication, Joan Lledó, 2018/08/07
- [PATCH 4/4] lwip: Fix a buffer overflow and clear compiler warnings, Joan Lledó, 2018/08/07
- Re: Patches: lwip translator, Samuel Thibault, 2018/08/09
- [PATCH 2/4] lwip: refactor main demuxer to avoid code duplication, Joan Lledó, 2018/08/11
- Re: [PATCH 2/4] lwip: refactor main demuxer to avoid code duplication, Samuel Thibault, 2018/08/13
- [PATCH 4/4] lwip: Fix a buffer overflow and clear compiler warnings, Joan Lledó, 2018/08/11
- Re: [PATCH 4/4] lwip: Fix a buffer overflow and clear compiler warnings, Samuel Thibault, 2018/08/14
- Re: [PATCH 4/4] lwip: Fix a buffer overflow and clear compiler warnings, Joan Lledó, 2018/08/14
- Re: [PATCH 4/4] lwip: Fix a buffer overflow and clear compiler warnings, Samuel Thibault, 2018/08/14