summaryrefslogtreecommitdiff
path: root/libfshelp
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2013-11-25 17:01:30 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2013-11-28 23:04:22 +0100
commit34ff01a84390ba7a5c0377c326944fc026d66140 (patch)
tree143868006bb39f6a615ecf066b906e11fb6d892e /libfshelp
parentf0023823ef3282bd3483e6a7aa19b0a0939a6ba4 (diff)
libfshelp: improve error handling in fshelp_start_translator_long
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.
Diffstat (limited to 'libfshelp')
-rw-r--r--libfshelp/start-translator-long.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libfshelp/start-translator-long.c b/libfshelp/start-translator-long.c
index 55fb0ff6..64a20bed 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)
{