summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/db/hash/hash.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c
index 76da99c..ea6ff47 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;
OpenPOWER on IntegriCloud