summaryrefslogtreecommitdiff
path: root/lib/libc/db
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-02-16 21:57:54 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-02-16 21:57:54 +0000
commit6a3fc2a3c921ac3cd57bf399c7f1a65b92ba589e (patch)
tree249f534af5d174f2bb3e0ac889d0cf7eefd08b1f /lib/libc/db
parent3d144d51bb3a8097ff22e539179a77fc294747df (diff)
real dbm_rdonly
Diffstat (limited to 'lib/libc/db')
-rw-r--r--lib/libc/db/hash/ndbm.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/libc/db/hash/ndbm.c b/lib/libc/db/hash/ndbm.c
index 3eb7a6308df..ef1bceaf804 100644
--- a/lib/libc/db/hash/ndbm.c
+++ b/lib/libc/db/hash/ndbm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ndbm.c,v 1.9 1999/02/16 21:21:04 imp Exp $ */
+/* $OpenBSD: ndbm.c,v 1.10 1999/02/16 21:57:53 millert Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -40,7 +40,7 @@
#if 0
static char sccsid[] = "@(#)dbm.c 8.6 (Berkeley) 11/7/95";
#else
-static char rcsid[] = "$OpenBSD: ndbm.c,v 1.9 1999/02/16 21:21:04 imp Exp $";
+static char rcsid[] = "$OpenBSD: ndbm.c,v 1.10 1999/02/16 21:57:53 millert Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -54,9 +54,6 @@ static char rcsid[] = "$OpenBSD: ndbm.c,v 1.9 1999/02/16 21:21:04 imp Exp $";
#include <ndbm.h>
#include "hash.h"
-/* KLUDGE */
-#define dbm_rdonly(a) (0)
-
/*
*
* This package provides dbm and ndbm compatible interfaces to DB.
@@ -339,5 +336,16 @@ int
dbm_dirfno(db)
DBM *db;
{
+
return(((HTAB *)db->internal)->fp);
}
+
+int
+dbm_rdonly(dbp)
+ DBM *dbp;
+{
+ HTAB *hashp = (HTAB *)dbp->internal;
+
+ /* Could use DBM_RDONLY instead if we wanted... */
+ return ((hashp->flags & O_ACCMODE) == O_RDONLY);
+}