diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c index 76da99c055a..ea6ff4731ed 100644 --- a/lib/libc/db/hash/hash.c +++ b/lib/libc/db/hash/hash.c @@ -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;