From 8f6a30afba1e995e2302969f7a883a259d7f2a5d Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Wed, 29 Aug 2012 10:50:08 +0100 Subject: [PATCH] Updated the Blockinator code to avoid using fcntl() on NFS. No file-locking is required when opening the file in read-only mode. --- apache/mod_blockinator.c | 2 +- varnish/blockinator.vcl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apache/mod_blockinator.c b/apache/mod_blockinator.c index 141ff1a..699b21b 100644 --- a/apache/mod_blockinator.c +++ b/apache/mod_blockinator.c @@ -121,7 +121,7 @@ static void mod_blockinator_init_handler(apr_pool_t *p, server_rec *s) sprintf(sqlite3_instr_extension, "%s/sqlite_instr/instr.sqlext", cfg->basepath); /* Open the SQLite DB */ - if (sqlite3_open_v2(cfg->db, &db, SQLITE_OPEN_READONLY, NULL)) { + if (sqlite3_open_v2(cfg->db, &db, SQLITE_OPEN_READONLY, "unix-none")) { /* Error. */ ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, "mod_blockinator: SQLite error (%s). Could not open database.", sqlite3_errmsg(db)); } diff --git a/varnish/blockinator.vcl b/varnish/blockinator.vcl index d445403..0430bf0 100644 --- a/varnish/blockinator.vcl +++ b/varnish/blockinator.vcl @@ -19,7 +19,7 @@ C{ if (!init) { /* Open the SQLite DB */ - if (sqlite3_open_v2(BLOCKLIST_DB, &db, SQLITE_OPEN_READONLY, NULL)) { + if (sqlite3_open_v2(BLOCKLIST_DB, &db, SQLITE_OPEN_READONLY, "unix-none")) { syslog(LOG_ERR, "SQLite error (%s). Could not open database.", sqlite3_errmsg(db)); } init = 1;