]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(__hash_open): Correctly test for a read-write db. cvs/libc-961012
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 0db7b32b8c3b85fdea133c17075eb4b76d4f7735..1f26c7e68afc99981fe79e36358c1af82e4a7c3d 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;