(__hash_open): Correctly test for a read-write db.
authorMiles Bader <miles@gnu.org>
Sat, 12 Oct 1996 03:38:21 +0000 (03:38 +0000)
committerMiles Bader <miles@gnu.org>
Sat, 12 Oct 1996 03:38:21 +0000 (03:38 +0000)
db/hash/hash.c

index 0db7b32..1f26c7e 100644 (file)
@@ -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;