]> git.saurik.com Git - apple/libc.git/blobdiff - db/hash/FreeBSD/hash.c
Libc-763.13.tar.gz
[apple/libc.git] / db / hash / FreeBSD / hash.c
index a3538183716c5e7f1be1db986df8aa3d95c00ff4..8e41d8f2d1ce5ede5500650d18fddb4b5995ff15 100644 (file)
@@ -125,7 +125,8 @@ __hash_open(const char *file, int flags, int mode,
                        RETURN_ERROR(errno, error0);
                (void)_fcntl(hashp->fp, F_SETFD, 1);
                new_table = _fstat(hashp->fp, &statbuf) == 0 &&
-                   statbuf.st_size == 0 && (flags & O_ACCMODE) != O_RDONLY;
+                   statbuf.st_size == 0 &&
+                   ((flags & O_ACCMODE) != O_RDONLY || (flags & O_CREAT) != 0);
        } else
                new_table = 1;