mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
If a .db file is 0 length, initialize it as if it did not exist.
Reviewed by: wollman
This commit is contained in:
parent
c2dfe9fe01
commit
f0113fc0f7
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue