summaryrefslogtreecommitdiffstats
path: root/contrib/perl5/ext/GDBM_File/GDBM_File.xs
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/perl5/ext/GDBM_File/GDBM_File.xs')
-rw-r--r--contrib/perl5/ext/GDBM_File/GDBM_File.xs12
1 files changed, 10 insertions, 2 deletions
diff --git a/contrib/perl5/ext/GDBM_File/GDBM_File.xs b/contrib/perl5/ext/GDBM_File/GDBM_File.xs
index 870f056..5e426f9 100644
--- a/contrib/perl5/ext/GDBM_File/GDBM_File.xs
+++ b/contrib/perl5/ext/GDBM_File/GDBM_File.xs
@@ -42,12 +42,14 @@ typedef datum datum_value ;
typedef void (*FATALFUNC)();
+#ifndef GDBM_FAST
static int
not_here(char *s)
{
croak("GDBM_File::%s not implemented on this architecture", s);
return -1;
}
+#endif
/* GDBM allocates the datum with system malloc() and expects the user
* to free() it. So we either have to free() it immediately, or have
@@ -56,7 +58,7 @@ not_here(char *s)
static void
output_datum(pTHX_ SV *arg, char *str, int size)
{
-#if !defined(MYMALLOC) || (defined(MYMALLOC) && defined(PERL_POLLUTE_MALLOC))
+#if !defined(MYMALLOC) || (defined(MYMALLOC) && defined(PERL_POLLUTE_MALLOC) && !defined(LEAKTEST))
sv_usepvn(arg, str, size);
#else
sv_setpvn(arg, str, size);
@@ -122,6 +124,12 @@ constant(char *name, int arg)
#else
goto not_there;
#endif
+ if (strEQ(name, "GDBM_NOLOCK"))
+#ifdef GDBM_NOLOCK
+ return GDBM_NOLOCK;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "GDBM_READER"))
#ifdef GDBM_READER
return GDBM_READER;
@@ -214,7 +222,7 @@ gdbm_TIEHASH(dbtype, name, read_write, mode, fatal_func = (FATALFUNC)croak)
GDBM_FILE dbp ;
RETVAL = NULL ;
- if (dbp = gdbm_open(name, GDBM_BLOCKSIZE, read_write, mode, fatal_func)) {
+ if ((dbp = gdbm_open(name, GDBM_BLOCKSIZE, read_write, mode, fatal_func))) {
RETVAL = (GDBM_File)safemalloc(sizeof(GDBM_File_type)) ;
Zero(RETVAL, 1, GDBM_File_type) ;
RETVAL->dbp = dbp ;
OpenPOWER on IntegriCloud