From: Miles Bader Date: Sat, 12 Oct 1996 03:38:21 +0000 (+0000) Subject: (__hash_open): Correctly test for a read-write db. X-Git-Tag: cvs/libc-961012 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=201d97bbe938892fce5666ab251d5b9387145f52;p=thirdparty%2Fglibc.git (__hash_open): Correctly test for a read-write db. --- diff --git a/db/hash/hash.c b/db/hash/hash.c index 0db7b32b8c3..1f26c7e68af 100644 --- a/db/hash/hash.c +++ b/db/hash/hash.c @@ -189,7 +189,7 @@ __hash_open(file, flags, mode, info, dflags) __buf_init(hashp, DEF_BUFSIZE); hashp->new_file = new_table; - hashp->save_file = file && (hashp->flags & O_RDWR); + hashp->save_file = file && (hashp->flags & O_ACCMODE) != O_RDONLY; hashp->cbucket = -1; if (!(dbp = (DB *)malloc(sizeof(DB)))) { save_errno = errno;