summaryrefslogtreecommitdiff
path: root/lib/libc/db
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2015-05-11 06:31:18 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2015-05-11 06:31:18 +0000
commite7adfc42b4982d81907aac13902bddc965027d8d (patch)
tree7a0001a828855d58027c942e6b3409f633995fdb /lib/libc/db
parent5d92d12b3027279828ad4ffb1f005a5ac5854f3c (diff)
Whoops, need to pass through O_ACCMODE flags to the underlying __*_open()
problem pointed out by Mark Patruck (mark (at) wrapped.cx)
Diffstat (limited to 'lib/libc/db')
-rw-r--r--lib/libc/db/db/db.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/db/db/db.c b/lib/libc/db/db/db.c
index 8c5f78dacf7..8f54ccf451d 100644
--- a/lib/libc/db/db/db.c
+++ b/lib/libc/db/db/db.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db.c,v 1.11 2015/05/11 00:42:54 guenther Exp $ */
+/* $OpenBSD: db.c,v 1.12 2015/05/11 06:31:17 guenther Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -48,10 +48,10 @@ dbopen(const char *fname, int flags, int mode, DBTYPE type,
#define DB_FLAGS (DB_LOCK | DB_SHMEM | DB_TXN)
#define USE_OPEN_FLAGS \
(O_CREAT | O_EXCL | O_EXLOCK | O_NOFOLLOW | O_NONBLOCK | \
- O_SHLOCK | O_SYNC | O_TRUNC)
+ O_ACCMODE | O_SHLOCK | O_SYNC | O_TRUNC)
if (((flags & O_ACCMODE) == O_RDONLY || (flags & O_ACCMODE) == O_RDWR)
- && (flags & ~(O_ACCMODE | USE_OPEN_FLAGS | DB_FLAGS)) == 0)
+ && (flags & ~(USE_OPEN_FLAGS | DB_FLAGS)) == 0)
switch (type) {
case DB_BTREE:
return (__bt_open(fname, flags & USE_OPEN_FLAGS,