diff options
Diffstat (limited to 'lib/libc/db')
-rw-r--r-- | lib/libc/db/hash/hash.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c index f3635ed7772..cd550fd06a3 100644 --- a/lib/libc/db/hash/hash.c +++ b/lib/libc/db/hash/hash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hash.c,v 1.8 1999/04/18 17:08:07 millert Exp $ */ +/* $OpenBSD: hash.c,v 1.9 2001/01/03 15:24:09 millert Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -40,7 +40,7 @@ #if 0 static char sccsid[] = "@(#)hash.c 8.9 (Berkeley) 6/16/94"; #else -static char rcsid[] = "$OpenBSD: hash.c,v 1.8 1999/04/18 17:08:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: hash.c,v 1.9 2001/01/03 15:24:09 millert Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -130,7 +130,7 @@ __hash_open(file, flags, mode, info, dflags) new_table = 0; if (!file || (flags & O_TRUNC) || ((rv = stat(file, &statbuf)) && errno == ENOENT) || - (rv == 0 && statbuf.st_size == 0)) { + (rv == 0 && !statbuf.st_size && (flags & O_ACCMODE) != O_RDONLY)) { if (errno == ENOENT) errno = 0; /* Just in case someone looks at errno */ new_table = 1; |