Clean up exiting

This commit is contained in:
Jaime Thomas 2008-04-07 20:40:30 +00:00
parent 2d78868112
commit f6a9daca9c

View File

@ -13,6 +13,7 @@ main(int argc, char **argv)
{ {
Ecdb_Project *proj; Ecdb_Project *proj;
int i; int i;
int ret = 0;
if (!ecore_init()) if (!ecore_init())
{ {
@ -23,13 +24,15 @@ main(int argc, char **argv)
if (!ecore_file_init()) if (!ecore_file_init())
{ {
printf("Cannot initialize Ecore_File!\n"); printf("Cannot initialize Ecore_File!\n");
return 1; ret = 1;
goto SHUTDOWN;
} }
if (!ecdb_setup()) if (!ecdb_setup())
{ {
printf("Setup failed\n"); printf("Setup failed\n");
return 1; ret = 1;
goto SHUTDOWN;
} }
ecdb_print_drive_info(); ecdb_print_drive_info();
@ -47,24 +50,32 @@ main(int argc, char **argv)
proj->publisher_id = proj->data_preparer_id = proj->system_id = proj->publisher_id = proj->data_preparer_id = proj->system_id =
proj->application_id = proj->copywrite_id = proj->abstract_id = proj->application_id = proj->copywrite_id = proj->abstract_id =
proj->biblio_id = "ecdb"; proj->biblio_id = "ecdb";
ecdb_aquire_drive(proj, 0);
if (ecdb_aquire_drive(proj, 0))
{
printf("Couldn't grab drive!\n");
ret = 1;
goto SHUTDOWN;
}
if (ecdb_burn_project(proj)) if (ecdb_burn_project(proj))
{ {
printf("Burn was unsuccessful\n"); printf("Burn was unsuccessful\n");
burn_finish(); ret = 1;
ecore_event_add(ECORE_EVENT_SIGNAL_EXIT, NULL, NULL, NULL); goto SHUTDOWN;
return 1;
} }
ecore_main_loop_begin(); ecore_main_loop_begin();
/* End testing */ /* End testing */
SHUTDOWN:
burn_finish(); burn_finish();
ecore_shutdown(); ecore_shutdown();
ecore_file_shutdown(); ecore_file_shutdown();
ecore_event_add(ECORE_EVENT_SIGNAL_EXIT, NULL, NULL, NULL);
printf("Program Done\n"); printf("Program Done\n");
return 0; return ret;
}; };
int int