aboutsummaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
Diffstat (limited to 'compat')
-rw-r--r--compat/dbmclose.c2
-rw-r--r--compat/dbmdelete.c2
-rw-r--r--compat/dbmdirfno.c2
-rw-r--r--compat/dbmfetch.c2
-rw-r--r--compat/dbmopen.c21
-rw-r--r--compat/dbmpagfno.c2
-rw-r--r--compat/dbmrdonly.c2
-rw-r--r--compat/dbmseq.c4
-rw-r--r--compat/dbmstore.c2
9 files changed, 22 insertions, 17 deletions
diff --git a/compat/dbmclose.c b/compat/dbmclose.c
index 30626cc..c0c3f61 100644
--- a/compat/dbmclose.c
+++ b/compat/dbmclose.c
@@ -26,7 +26,7 @@
/* Close the DBF file. */
void
-dbm_close (gdbm_file_info *dbf)
+dbm_close (GDBM_FILE dbf)
{
gdbm_close (dbf);
}
diff --git a/compat/dbmdelete.c b/compat/dbmdelete.c
index f5b5d6b..c24d053 100644
--- a/compat/dbmdelete.c
+++ b/compat/dbmdelete.c
@@ -28,7 +28,7 @@
/* Remove the KEYed item and the KEY from the database DBF. */
int
-dbm_delete (gdbm_file_info *dbf, datum key)
+dbm_delete (GDBM_FILE dbf, datum key)
{
return gdbm_delete (dbf,key);
}
diff --git a/compat/dbmdirfno.c b/compat/dbmdirfno.c
index ae22cc2..79d9c24 100644
--- a/compat/dbmdirfno.c
+++ b/compat/dbmdirfno.c
@@ -27,7 +27,7 @@
file number. Since we have only one file number, we return it. */
int
-dbm_dirfno (gdbm_file_info *dbf)
+dbm_dirfno (GDBM_FILE dbf)
{
return (dbf->desc);
}
diff --git a/compat/dbmfetch.c b/compat/dbmfetch.c
index bb650a4..54784c4 100644
--- a/compat/dbmfetch.c
+++ b/compat/dbmfetch.c
@@ -29,7 +29,7 @@
dynamically allocated memory block. */
datum
-dbm_fetch (gdbm_file_info *dbf, datum key)
+dbm_fetch (GDBM_FILE dbf, datum key)
{
datum ret_val; /* The return value. */
diff --git a/compat/dbmopen.c b/compat/dbmopen.c
index 257da77..309d08f 100644
--- a/compat/dbmopen.c
+++ b/compat/dbmopen.c
@@ -42,15 +42,15 @@
a GDBM_NEWDB. All other values of FLAGS in the flags are
ignored. */
-gdbm_file_info *
+GDBM_FILE
dbm_open (char *file, int flags, int mode)
{
char* pag_file; /* Used to construct "file.pag". */
char* dir_file; /* Used to construct "file.dir". */
struct stat dir_stat; /* Stat information for "file.dir". */
- gdbm_file_info *temp_dbf; /* Temporary file pointer storage. */
-
-
+ GDBM_FILE temp_dbf; /* Temporary file pointer storage. */
+ int open_flags;
+
/* Prepare the correct names of "file.pag" and "file.dir". */
pag_file = (char *) malloc (strlen (file)+5);
dir_file = (char *) malloc (strlen (file)+5);
@@ -68,23 +68,28 @@ dbm_open (char *file, int flags, int mode)
/* Call the actual routine, saving the pointer to the file information. */
flags &= O_RDONLY | O_RDWR | O_CREAT | O_TRUNC;
+
if (flags == O_RDONLY)
{
- temp_dbf = gdbm_open (pag_file, 0, GDBM_READER, 0, NULL);
+ open_flags = GDBM_READER;
+ mode = 0;
}
else if (flags == (O_RDWR | O_CREAT))
{
- temp_dbf = gdbm_open (pag_file, 0, GDBM_WRCREAT, mode, NULL);
+ open_flags = GDBM_WRCREAT;
}
else if ( (flags & O_TRUNC) == O_TRUNC)
{
- temp_dbf = gdbm_open (pag_file, 0, GDBM_NEWDB, mode, NULL);
+ open_flags = GDBM_NEWDB;
}
else
{
- temp_dbf = gdbm_open (pag_file, 0, GDBM_WRITER, 0, NULL);
+ open_flags = GDBM_WRITER;
+ mode = 0;
}
+ temp_dbf = gdbm_open (pag_file, 0, open_flags | GDBM_NOLOCK, mode, NULL);
+
/* Did we successfully open the file? */
if (temp_dbf == NULL)
{
diff --git a/compat/dbmpagfno.c b/compat/dbmpagfno.c
index ae9d8cb..8532c03 100644
--- a/compat/dbmpagfno.c
+++ b/compat/dbmpagfno.c
@@ -27,7 +27,7 @@
file number. Since we have only one file number, we return it. */
int
-dbm_pagfno (gdbm_file_info *dbf)
+dbm_pagfno (GDBM_FILE dbf)
{
return (dbf->desc);
}
diff --git a/compat/dbmrdonly.c b/compat/dbmrdonly.c
index 14d89c7..33e3274 100644
--- a/compat/dbmrdonly.c
+++ b/compat/dbmrdonly.c
@@ -26,7 +26,7 @@
/* not much of a routine, but should be a function for compatibility. */
int
-dbm_rdonly(gdbm_file_info *dbf)
+dbm_rdonly(GDBM_FILE dbf)
{
return (dbf->read_write == GDBM_READER);
}
diff --git a/compat/dbmseq.c b/compat/dbmseq.c
index d702241..7e1bed5 100644
--- a/compat/dbmseq.c
+++ b/compat/dbmseq.c
@@ -30,7 +30,7 @@
information pointer. */
datum
-dbm_firstkey (gdbm_file_info *dbf)
+dbm_firstkey (GDBM_FILE dbf)
{
datum ret_val;
@@ -49,7 +49,7 @@ dbm_firstkey (gdbm_file_info *dbf)
DBF is the file information pointer. */
datum
-dbm_nextkey (gdbm_file_info *dbf)
+dbm_nextkey (GDBM_FILE dbf)
{
datum ret_val;
diff --git a/compat/dbmstore.c b/compat/dbmstore.c
index ac102ea..9d904ff 100644
--- a/compat/dbmstore.c
+++ b/compat/dbmstore.c
@@ -29,7 +29,7 @@
database before returning from this procedure. */
int
-dbm_store (gdbm_file_info *dbf, datum key, datum content, int flags)
+dbm_store (GDBM_FILE dbf, datum key, datum content, int flags)
{
return gdbm_store (dbf, key, content, flags);
}

Return to:

Send suggestions and report system problems to the System administrator.