diff options
author | Marc-André Lureau <marcandre.lureau@gmail.com> | 2012-12-17 14:28:02 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-01-09 13:56:07 +0100 |
commit | 6f89276d0065a3476f9072ae5ec116633f56bdc1 (patch) | |
tree | 19365dabe7ced913873aa4d14b70472972ca4fce /tools/msibuild.c | |
parent | 694a948ae7e29b6bd1000c293727ad3651fb270f (diff) | |
download | msitools-6f89276d0065a3476f9072ae5ec116633f56bdc1.tar.gz msitools-6f89276d0065a3476f9072ae5ec116633f56bdc1.tar.xz msitools-6f89276d0065a3476f9072ae5ec116633f56bdc1.zip |
database: make commit() GObject-like
Diffstat (limited to 'tools/msibuild.c')
-rw-r--r-- | tools/msibuild.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/tools/msibuild.c b/tools/msibuild.c index ff69cc4..cf52820 100644 --- a/tools/msibuild.c +++ b/tools/msibuild.c @@ -101,12 +101,11 @@ static LibmsiResult open_database(const char *msifile, LibmsiDatabase **db, if (!init_suminfo(*si, error)) return LIBMSI_RESULT_FUNCTION_FAILED; - r = libmsi_database_commit(*db); - if (r != LIBMSI_RESULT_SUCCESS) + if (!libmsi_database_commit(*db, error)) { - fprintf(stderr, "failed to commit database (%u)\n", r); + fprintf(stderr, "failed to commit database\n"); g_object_unref(*db); - return r; + return LIBMSI_RESULT_FUNCTION_FAILED; } } else @@ -330,16 +329,11 @@ int main(int argc, char *argv[]) } if (r == LIBMSI_RESULT_SUCCESS) { - libmsi_summary_info_persist(si, &error); - if (error) + if (!libmsi_summary_info_persist(si, &error)) goto end; - r = libmsi_database_commit(db); - if (r != LIBMSI_RESULT_SUCCESS) - { - fprintf(stderr, "failed to commit database (%u)\n", r); - exit(1); - } + if (!libmsi_database_commit(db, &error)) + goto end; } end: |