summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2016-05-31 18:32:57 +0000
committered <ed@FreeBSD.org>2016-05-31 18:32:57 +0000
commit7c40d543e864474b396f78f0a3fd916704e2f015 (patch)
tree82ba49d3544b9ad1861941e2d47ab93a63790efc
parenta2e427a148f6688e4ea3b76fcf75f1b64d47e50f (diff)
downloadFreeBSD-src-7c40d543e864474b396f78f0a3fd916704e2f015.zip
FreeBSD-src-7c40d543e864474b396f78f0a3fd916704e2f015.tar.gz
Fix prototype of dbm_open().
The last argument of dbm_open() should be a mode_t according to POSIX; not an int. Reviewed by: pfg, kib Differential Revision: https://reviews.freebsd.org/D6650
-rw-r--r--include/ndbm.h2
-rw-r--r--lib/libc/db/hash/ndbm.c2
-rw-r--r--lib/libc/db/man/dbm.32
3 files changed, 3 insertions, 3 deletions
diff --git a/include/ndbm.h b/include/ndbm.h
index 1257c92..db83803 100644
--- a/include/ndbm.h
+++ b/include/ndbm.h
@@ -70,7 +70,7 @@ datum dbm_firstkey(DBM *);
long dbm_forder(DBM *, datum);
#endif
datum dbm_nextkey(DBM *);
-DBM *dbm_open(const char *, int, int);
+DBM *dbm_open(const char *, int, mode_t);
int dbm_store(DBM *, datum, datum, int);
#if __BSD_VISIBLE
int dbm_dirfno(DBM *);
diff --git a/lib/libc/db/hash/ndbm.c b/lib/libc/db/hash/ndbm.c
index 37adaf6..1a02d00 100644
--- a/lib/libc/db/hash/ndbm.c
+++ b/lib/libc/db/hash/ndbm.c
@@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$");
* NULL on failure
*/
extern DBM *
-dbm_open(const char *file, int flags, int mode)
+dbm_open(const char *file, int flags, mode_t mode)
{
HASHINFO info;
char path[MAXPATHLEN];
diff --git a/lib/libc/db/man/dbm.3 b/lib/libc/db/man/dbm.3
index c16f517..4fe5d82 100644
--- a/lib/libc/db/man/dbm.3
+++ b/lib/libc/db/man/dbm.3
@@ -34,7 +34,7 @@
.In fcntl.h
.In ndbm.h
.Ft DBM *
-.Fn dbm_open "const char *base" "int flags" "int mode"
+.Fn dbm_open "const char *base" "int flags" "mode_t mode"
.Ft void
.Fn dbm_close "DBM *db"
.Ft int
OpenPOWER on IntegriCloud