From d223397c4e03dd274a3ba7af89743709189117f7 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Wed, 17 Feb 2010 13:58:16 +0000 Subject: [PATCH] Bug fix for FreeBSD: xorriso could leave the drive tray locked --- libisoburn/trunk/xorriso/xorriso.c | 19 +++++++++++++------ libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/libisoburn/trunk/xorriso/xorriso.c b/libisoburn/trunk/xorriso/xorriso.c index d2f49b81..818f6da6 100644 --- a/libisoburn/trunk/xorriso/xorriso.c +++ b/libisoburn/trunk/xorriso/xorriso.c @@ -20658,7 +20658,7 @@ int main(int argc, char **argv) /* The following functions are allowed only after this initialization */ ret= Xorriso_startup_libraries(xorriso, 0); if(ret <= 0) - exit(4); + {ret= 4; goto emergency_exit;} Xorriso_process_msg_queues(xorriso, 0); /* Interpret startup files */ @@ -20666,26 +20666,26 @@ int main(int argc, char **argv) if(ret == 3) goto end_sucessfully; if(ret <= 0) - exit(5); + {ret= 5; goto emergency_exit;} /* Interpret program arguments */ orig_argv= argv; ret= Xorriso_program_arg_bsl(xorriso, argc, &argv, 0); if(ret <= 0) - exit(5); + {ret= 5; goto emergency_exit;} i= 1; ret= Xorriso_interpreter(xorriso, argc, argv, &i, 2); if(ret == 3) goto end_sucessfully; if(ret <= 0) - exit(5); + {ret= 5; goto emergency_exit;} /* Enter dialog mode if it has been activated meanwhile */ ret= Xorriso_dialog(xorriso, 0); if(ret <= 0) - exit(6); + {ret= 6; goto emergency_exit;} -end_sucessfully:; +end_sucessfully:; /* normal shutdown, including eventual -commit */ Xorriso_process_msg_queues(xorriso, 0); if(Xorriso_change_is_pending(xorriso, 0)) Xorriso_option_end(xorriso, 2); @@ -20700,6 +20700,13 @@ end_sucessfully:; free(argv); } exit(ret); + +emergency_exit:; + if(xorriso != NULL) { /* minimal shutdown */ + Xorriso_process_msg_queues(xorriso, 0); + Xorriso_destroy(&xorriso, 1); + } + exit(ret); } #endif /* Xorriso_with_maiN */ diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index bce96135..f0426344 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2010.02.15.204530" +#define Xorriso_timestamP "2010.02.17.140002"