sc_bool sc_fs_storage_shutdown(sc_segment **segments) { g_message("Shutdown sc-storage"); g_message("Write segments"); sc_fs_storage_write_to_path(segments); g_message("Save file memory state"); if (sc_fm_save(fm_engine) != SC_RESULT_OK) g_critical("Error while saves file memory"); g_free(repo_path); return SC_TRUE; }
sc_bool sc_fs_storage_shutdown(sc_segment **segments, sc_bool save_segments) { g_message("Shutdown sc-storage"); if (save_segments == SC_TRUE) { g_message("Write segments"); sc_fs_storage_write_to_path(segments); } sc_bool res = SC_FALSE; sc_fm_free(fm_engine); fFmEngineShutdownFunc func; g_message("Shutting down file memory engine: %s", fm_engine_module_path); if (g_module_symbol(fm_engine_module, "shutdown", (gpointer*) &func) == FALSE) { g_critical("Can't find 'shutdown' symbol in module: %s", fm_engine_module_path); }else { if (func() != SC_RESULT_OK) g_critical("Can't shutdown file memory properly: %s", fm_engine_module_path); else res = SC_TRUE; } if (g_module_close(fm_engine_module) != TRUE) g_critical("Error while close module: %s", fm_engine_module_path); fm_engine = 0; fm_engine_module = 0; g_free(repo_path); return res; }