summaryrefslogtreecommitdiff
path: root/ext/dbm
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dbm')
-rw-r--r--ext/dbm/dbm.c2
-rw-r--r--ext/dbm/extconf.rb7
2 files changed, 2 insertions, 7 deletions
diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c
index 6413f3a5ee..e75166506b 100644
--- a/ext/dbm/dbm.c
+++ b/ext/dbm/dbm.c
@@ -639,9 +639,7 @@ fdbm_store(VALUE obj, VALUE keystr, VALUE valstr)
GetDBM2(obj, dbmp, dbm);
dbmp->di_size = -1;
if (dbm_store(dbm, key, val, DBM_REPLACE)) {
-#ifdef HAVE_DBM_CLEARERR
dbm_clearerr(dbm);
-#endif
if (errno == EPERM) rb_sys_fail(0);
rb_raise(rb_eDBMError, "dbm_store failed");
}
diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb
index a2c3b7c1a3..5c6c183eac 100644
--- a/ext/dbm/extconf.rb
+++ b/ext/dbm/extconf.rb
@@ -29,23 +29,20 @@ headers.found = []
headers.defs = nil
def headers.db_check(db)
- have_gdbm = false
hsearch = nil
case db
when /^db[2-5]?$/
hsearch = "-DDB_DBM_HSEARCH"
when "gdbm"
- have_gdbm = true
when "gdbm_compat"
- have_gdbm = true
have_library("gdbm") or return false
end
if (hdr = self.fetch(db, ["ndbm.h"]).find {|h| have_type("DBM", h, hsearch)} or
hdr = self.fetch(db, ["ndbm.h"]).find {|h| have_type("DBM", ["db.h", h], hsearch)}) and
- (have_library(db, 'dbm_open("", 0, 0)', hdr, hsearch) || have_func('dbm_open("", 0, 0)', hdr, hsearch))
- have_func('dbm_clearerr((DBM *)0)', hdr, hsearch) unless have_gdbm
+ (have_library(db, 'dbm_open("", 0, 0)', hdr, hsearch) || have_func('dbm_open("", 0, 0)', hdr, hsearch)) and
+ have_func('dbm_clearerr((DBM *)0)', hdr, hsearch)
if hsearch
$defs << hsearch
@defs = hsearch