[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 08/11] libfshelp: improve error handling in fshelp_start_tran
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 08/11] libfshelp: improve error handling in fshelp_start_translator_long |
Date: |
Wed, 27 Nov 2013 22:47:39 +0100 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Justus Winter, le Wed 27 Nov 2013 13:31:15 +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.
> ---
> libfshelp/start-translator-long.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/libfshelp/start-translator-long.c
> b/libfshelp/start-translator-long.c
> index 55fb0ff..864726f 100644
> --- a/libfshelp/start-translator-long.c
> +++ b/libfshelp/start-translator-long.c
> @@ -297,12 +297,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;
> + {
> + task_terminate (task);
> + goto lose;
> + }
>
> /* 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);
Mmm, rather introduce lose_task label here and use it?
> + if (err)
> + task_terminate (task);
>
> lose:
> if (!ports_moved)
- Re: [PATCH 05/11] libports: improve error handling in ports_reallocate_from_external, (continued)
- [PATCH 06/11] libports: improve error handling in ports_transfer_right, Justus Winter, 2013/11/27
- [PATCH 07/11] libdiskfs: improve error reporting in diskfs_start_disk_pager, Justus Winter, 2013/11/27
- [PATCH 10/11] proc: store the privileged host port in _hurd_host_priv, Justus Winter, 2013/11/27
- [PATCH 09/11] libports: improve error reporting in adjust_priority, Justus Winter, 2013/11/27
- [PATCH 08/11] libfshelp: improve error handling in fshelp_start_translator_long, Justus Winter, 2013/11/27
- Re: [PATCH 08/11] libfshelp: improve error handling in fshelp_start_translator_long,
Samuel Thibault <=
- [PATCH 11/11] proc: store the device master port in _hurd_device_master, Justus Winter, 2013/11/27
- Re: [PATCH 01/11] libshouldbeinlibc: fix minor port leak in maptime_map, Samuel Thibault, 2013/11/27