Skip to content

Commit

Permalink
Fix ERROR_SQLITE macro.
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed May 17, 2014
1 parent b215e9b commit 6078fa4
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 116 deletions.
6 changes: 3 additions & 3 deletions libpkg/backup.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ copy_database(sqlite3 *src, sqlite3 *dst, const char *name)
if (ret == SQLITE_BUSY) {
sqlite3_sleep(250);
} else {
ERROR_SQLITE(dst);
ERROR_SQLITE(dst, "PRAGMA page_size");
break;
}
}
Expand Down Expand Up @@ -152,7 +152,7 @@ pkgdb_dump(struct pkgdb *db, const char *dest)
ret = sqlite3_open(dest, &backup);

if (ret != SQLITE_OK) {
ERROR_SQLITE(backup);
ERROR_SQLITE(backup, "sqlite3_open");
sqlite3_close(backup);
return (EPKG_FATAL);
}
Expand All @@ -178,7 +178,7 @@ pkgdb_load(struct pkgdb *db, const char *src)
ret = sqlite3_open(src, &restore);

if (ret != SQLITE_OK) {
ERROR_SQLITE(restore);
ERROR_SQLITE(restore, "sqlite3_open");
sqlite3_close(restore);
return (EPKG_FATAL);
}
Expand Down
4 changes: 2 additions & 2 deletions libpkg/pkg_repo_update.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ pkg_repo_register(struct pkg_repo *repo, sqlite3 *sqlite)
}

if (sqlite3_prepare_v2(sqlite, sql, -1, &stmt, NULL) != SQLITE_OK) {
ERROR_SQLITE(sqlite);
ERROR_SQLITE(sqlite, sql);
return (EPKG_FATAL);
}

sqlite3_bind_text(stmt, 1, pkg_repo_url(repo), -1, SQLITE_STATIC);

if (sqlite3_step(stmt) != SQLITE_DONE) {
ERROR_SQLITE(sqlite);
ERROR_SQLITE(sqlite, sql);
sqlite3_finalize(stmt);
return (EPKG_FATAL);
}
Expand Down
Loading

0 comments on commit 6078fa4

Please sign in to comment.