summaryrefslogtreecommitdiffstats
path: root/mansearch.c
diff options
context:
space:
mode:
Diffstat (limited to 'mansearch.c')
-rw-r--r--mansearch.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/mansearch.c b/mansearch.c
index 37b1e6b3..0db8edbf 100644
--- a/mansearch.c
+++ b/mansearch.c
@@ -54,17 +54,17 @@ extern const char *const mansearch_keynames[];
#define SQL_BIND_TEXT(_db, _s, _i, _v) \
do { if (SQLITE_OK != sqlite3_bind_text \
((_s), (_i)++, (_v), -1, SQLITE_STATIC)) \
- warnx("%s", sqlite3_errmsg((_db))); \
+ errx((int)MANDOCLEVEL_SYSERR, "%s", sqlite3_errmsg((_db))); \
} while (0)
#define SQL_BIND_INT64(_db, _s, _i, _v) \
do { if (SQLITE_OK != sqlite3_bind_int64 \
((_s), (_i)++, (_v))) \
- warnx("%s", sqlite3_errmsg((_db))); \
+ errx((int)MANDOCLEVEL_SYSERR, "%s", sqlite3_errmsg((_db))); \
} while (0)
#define SQL_BIND_BLOB(_db, _s, _i, _v) \
do { if (SQLITE_OK != sqlite3_bind_blob \
((_s), (_i)++, (&_v), sizeof(_v), SQLITE_STATIC)) \
- warnx("%s", sqlite3_errmsg((_db))); \
+ errx((int)MANDOCLEVEL_SYSERR, "%s", sqlite3_errmsg((_db))); \
} while (0)
struct expr {
@@ -262,7 +262,8 @@ mansearch(const struct mansearch *search,
j = 1;
c = sqlite3_prepare_v2(db, sql, -1, &s, NULL);
if (SQLITE_OK != c)
- warnx("%s", sqlite3_errmsg(db));
+ errx((int)MANDOCLEVEL_SYSERR,
+ "%s", sqlite3_errmsg(db));
for (ep = e; NULL != ep; ep = ep->next) {
if (NULL == ep->substr) {
@@ -312,14 +313,16 @@ mansearch(const struct mansearch *search,
"WHERE pageid=? ORDER BY sec, arch, name",
-1, &s, NULL);
if (SQLITE_OK != c)
- warnx("%s", sqlite3_errmsg(db));
+ errx((int)MANDOCLEVEL_SYSERR,
+ "%s", sqlite3_errmsg(db));
c = sqlite3_prepare_v2(db,
"SELECT bits, key, pageid FROM keys "
"WHERE pageid=? AND bits & ?",
-1, &s2, NULL);
if (SQLITE_OK != c)
- warnx("%s", sqlite3_errmsg(db));
+ errx((int)MANDOCLEVEL_SYSERR,
+ "%s", sqlite3_errmsg(db));
for (mp = ohash_first(&htab, &idx);
NULL != mp;