bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] libfshelp: improve error handling in fshelp_start_translator


From: Samuel Thibault
Subject: Re: [PATCH] libfshelp: improve error handling in fshelp_start_translator_long
Date: Thu, 28 Nov 2013 13:27:04 +0100
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Justus Winter, le Thu 28 Nov 2013 13:11:44 +0100, a écrit :
> Properly deallocate all ports and terminate the started translator if
> an error occurs.
> 
> * libfshelp/start-translator-long.c (fshelp_start_translator_long):
>   Improve error handling.

Ack.

> ---
>  libfshelp/start-translator-long.c |   11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/libfshelp/start-translator-long.c 
> b/libfshelp/start-translator-long.c
> index 55fb0ff..64a20be 100644
> --- a/libfshelp/start-translator-long.c
> +++ b/libfshelp/start-translator-long.c
> @@ -285,10 +285,7 @@ fshelp_start_translator_long (fshelp_open_fn_t 
> underlying_open_fn,
>    ports[INIT_PORT_BOOTSTRAP] = saveport;
>  
>    if (err)
> -    {
> -      task_terminate (task);
> -      goto lose;
> -    }
> +    goto lose_task;
>  
>    /* Ask to be told if TASK dies.  */
>    err =
> @@ -297,13 +294,17 @@ fshelp_start_translator_long (fshelp_open_fn_t 
> underlying_open_fn,
>                                  bootstrap, MACH_MSG_TYPE_MAKE_SEND_ONCE,
>                                  &prev_notify);
>    if (err)
> -    return err;
> +    goto lose_task;
>  
>    /* Ok, cool, we've got a running(?) program, now rendezvous with it if
>       possible using the startup protocol on the bootstrap port... */
>    err = service_fsys_startup(underlying_open_fn, cookie, bootstrap,
>                            timeout, control, task);
>  
> + lose_task:
> +  if (err)
> +    task_terminate (task);
> +
>   lose:
>    if (!ports_moved)
>      {
> -- 
> 1.7.10.4
> 

-- 
Samuel
<k> faut en profiter, aujourd'hui, les blagues bidon sont à 100 dollars
 -+- #sos-bourse -+-



reply via email to

[Prev in Thread] Current Thread [Next in Thread]