diff options
Diffstat (limited to 'src/analysis/db/cdb.c')
-rw-r--r-- | src/analysis/db/cdb.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/analysis/db/cdb.c b/src/analysis/db/cdb.c index e03b875..2013750 100644 --- a/src/analysis/db/cdb.c +++ b/src/analysis/db/cdb.c @@ -297,7 +297,10 @@ GCdbArchive *g_cdb_archive_new(const char *basedir, const char *tmpdir, const rl GCdbArchive *result; /* Adresse à retourner */ int ret; /* Retour d'un appel */ struct stat finfo; /* Information sur l'archive */ - const char *id; /* Identifiant d'instantané */ + snapshot_id_t id; /* Identifiant d'instantané */ +#ifndef NDEBUG + bool status; /* Validité de l'identifiant */ +#endif result = g_object_new(G_TYPE_CDB_ARCHIVE, NULL); @@ -343,10 +346,14 @@ GCdbArchive *g_cdb_archive_new(const char *basedir, const char *tmpdir, const rl /* Récupération de la base courante */ - id = g_db_snapshot_get_current_id(result->snapshot); - assert(id != NULL); +#ifndef NDEBUG + status = g_db_snapshot_get_current_id(result->snapshot, &id); + assert(status); +#else + g_db_snapshot_get_current_id(result->snapshot, &id); +#endif - result->db = g_db_snapshot_get_database(result->snapshot, id); + result->db = g_db_snapshot_get_database(result->snapshot, &id); if (result->db == NULL) { @@ -372,10 +379,14 @@ GCdbArchive *g_cdb_archive_new(const char *basedir, const char *tmpdir, const rl /* Récupération de la base courante */ - id = g_db_snapshot_get_current_id(result->snapshot); - assert(id != NULL); +#ifndef NDEBUG + status = g_db_snapshot_get_current_id(result->snapshot, &id); + assert(status); +#else + g_db_snapshot_get_current_id(result->snapshot, &id); +#endif - result->db = g_db_snapshot_get_database(result->snapshot, id); + result->db = g_db_snapshot_get_database(result->snapshot, &id); if (result->db == NULL) { |