[prev in list] [next in list] [prev in thread] [next in thread]
List: hurd-bug
Subject: Re: [PATCH 2/4] lwip: refactor main demuxer to avoid code duplication
From: Samuel Thibault <samuel.thibault () gnu ! org>
Date: 2018-08-13 22:36:03
Message-ID: 20180813223603.fq34zndrds5re52v () var ! youpi ! perso ! aquilenet ! fr
[Download RAW message or body]
Joan Lledó, le sam. 11 août 2018 18:17:08 +0200, a ecrit:
> * lwip/main.c (lwip_demuxer): Refactored.
Applied, thanks!
> ---
> lwip/main.c | 42 +++++++++++-------------------------------
> 1 file changed, 11 insertions(+), 31 deletions(-)
>
> diff --git a/lwip/main.c b/lwip/main.c
> index 9f7eb9b2..4dfbe143 100644
> --- a/lwip/main.c
> +++ b/lwip/main.c
> @@ -99,6 +99,7 @@ int
> lwip_demuxer (mach_msg_header_t * inp, mach_msg_header_t * outp)
> {
> struct port_info *pi;
> + mig_routine_t routine = NULL;
>
> /* Clear errno to prevent raising previous errors again */
> errno = 0;
> @@ -116,40 +117,19 @@ lwip_demuxer (mach_msg_header_t * inp, mach_msg_header_t * outp)
> if (pi)
> {
> ports_port_deref (pi);
> -
> - mig_routine_t routine;
> - if ((routine = lwip_io_server_routine (inp)) ||
> - (routine = lwip_socket_server_routine (inp)) ||
> - (routine = lwip_pfinet_server_routine (inp)) ||
> - (routine = lwip_iioctl_server_routine (inp)) ||
> - (routine = NULL, trivfs_demuxer (inp, outp)) ||
> - (routine = lwip_startup_notify_server_routine (inp)))
> - {
> - if (routine)
> - (*routine) (inp, outp);
> - return TRUE;
> - }
> - else
> - return FALSE;
> + routine = lwip_io_server_routine (inp);
> }
> - else
> +
> + if (routine || (routine = lwip_socket_server_routine (inp)) ||
> + (routine = lwip_pfinet_server_routine (inp)) ||
> + (routine = lwip_iioctl_server_routine (inp)) ||
> + (routine = lwip_startup_notify_server_routine (inp)))
> {
> - mig_routine_t routine;
> - if ((routine = lwip_socket_server_routine (inp)) ||
> - (routine = lwip_pfinet_server_routine (inp)) ||
> - (routine = lwip_iioctl_server_routine (inp)) ||
> - (routine = NULL, trivfs_demuxer (inp, outp)) ||
> - (routine = lwip_startup_notify_server_routine (inp)))
> - {
> - if (routine)
> - (*routine) (inp, outp);
> - return TRUE;
> - }
> - else
> - return FALSE;
> + (*routine) (inp, outp);
> + return TRUE;
> }
> -
> - return 0;
> + else
> + return trivfs_demuxer (inp, outp);
> }
>
> void
> --
> 2.11.0
>
>
--
Samuel
<s> T'as pas de portable ?
<m> J'ai un nokia, dans le bassin d'arcachon
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic