X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/6990d062918770ee2431fb3310826c5aefbffccd..7b00c0c43f52e9d27168e67a26aac19065cdb40c:/db/hash/FreeBSD/hash.c diff --git a/db/hash/FreeBSD/hash.c b/db/hash/FreeBSD/hash.c index a353818..8e41d8f 100644 --- a/db/hash/FreeBSD/hash.c +++ b/db/hash/FreeBSD/hash.c @@ -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;