From: Nathan Wagner Date: Sun, 30 Sep 2018 23:09:18 +0000 (+0000) Subject: rollback on initialize failure X-Git-Tag: v0.2.0~9 X-Git-Url: https://pd.if.org/git/?a=commitdiff_plain;ds=sidebyside;h=042f84f74cd182f06d666781b67b015835bcf407;p=zpackage rollback on initialize failure --- diff --git a/lib/zpm.c b/lib/zpm.c index 30e8dc8..b7d9777 100644 --- a/lib/zpm.c +++ b/lib/zpm.c @@ -258,7 +258,6 @@ static #include "newdb.c" int zpm_db_initialize(struct zpm *pkg) { - //fprintf(stderr, "initializing zpm database\n"); char *error; switch (sqlite3_exec(pkg->db, createdb, (int (*)(void *,int,char **,char **))0, NULL, &error)) { case SQLITE_OK: break; @@ -266,6 +265,7 @@ int zpm_db_initialize(struct zpm *pkg) { SQLERROR(sqlite3_errmsg(pkg->db)); fprintf(stderr, "error: %s\n", error); sqlite3_free(error); + zpm_rollback(pkg); return 0; break; }