Bug fix for FreeBSD: xorriso could leave the drive tray locked

This commit is contained in:
Thomas Schmitt 2010-02-17 13:58:16 +00:00
parent 5df30507aa
commit d223397c4e
2 changed files with 14 additions and 7 deletions

View File

@ -20658,7 +20658,7 @@ int main(int argc, char **argv)
/* The following functions are allowed only after this initialization */ /* The following functions are allowed only after this initialization */
ret= Xorriso_startup_libraries(xorriso, 0); ret= Xorriso_startup_libraries(xorriso, 0);
if(ret <= 0) if(ret <= 0)
exit(4); {ret= 4; goto emergency_exit;}
Xorriso_process_msg_queues(xorriso, 0); Xorriso_process_msg_queues(xorriso, 0);
/* Interpret startup files */ /* Interpret startup files */
@ -20666,26 +20666,26 @@ int main(int argc, char **argv)
if(ret == 3) if(ret == 3)
goto end_sucessfully; goto end_sucessfully;
if(ret <= 0) if(ret <= 0)
exit(5); {ret= 5; goto emergency_exit;}
/* Interpret program arguments */ /* Interpret program arguments */
orig_argv= argv; orig_argv= argv;
ret= Xorriso_program_arg_bsl(xorriso, argc, &argv, 0); ret= Xorriso_program_arg_bsl(xorriso, argc, &argv, 0);
if(ret <= 0) if(ret <= 0)
exit(5); {ret= 5; goto emergency_exit;}
i= 1; i= 1;
ret= Xorriso_interpreter(xorriso, argc, argv, &i, 2); ret= Xorriso_interpreter(xorriso, argc, argv, &i, 2);
if(ret == 3) if(ret == 3)
goto end_sucessfully; goto end_sucessfully;
if(ret <= 0) if(ret <= 0)
exit(5); {ret= 5; goto emergency_exit;}
/* Enter dialog mode if it has been activated meanwhile */ /* Enter dialog mode if it has been activated meanwhile */
ret= Xorriso_dialog(xorriso, 0); ret= Xorriso_dialog(xorriso, 0);
if(ret <= 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); Xorriso_process_msg_queues(xorriso, 0);
if(Xorriso_change_is_pending(xorriso, 0)) if(Xorriso_change_is_pending(xorriso, 0))
Xorriso_option_end(xorriso, 2); Xorriso_option_end(xorriso, 2);
@ -20700,6 +20700,13 @@ end_sucessfully:;
free(argv); free(argv);
} }
exit(ret); 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 */ #endif /* Xorriso_with_maiN */

View File

@ -1 +1 @@
#define Xorriso_timestamP "2010.02.15.204530" #define Xorriso_timestamP "2010.02.17.140002"