If a .db file is 0 length, initialize it as if it did not exist.

Reviewed by:	wollman
This commit is contained in:
Paul Traina 1996-02-23 17:57:32 +00:00
parent c2dfe9fe01
commit f0113fc0f7

View file

@ -122,7 +122,8 @@ __hash_open(file, flags, mode, info, dflags)
new_table = 0;
if (!file || (flags & O_TRUNC) ||
(stat(file, &statbuf) && (errno == ENOENT))) {
(stat(file, &statbuf) && (errno == ENOENT)) ||
statbuf.st_size == 0) {
if (errno == ENOENT)
errno = 0; /* Just in case someone looks at errno */
new_table = 1;