mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-24 13:24:56 +08:00
Fix env_read_header() on Windows
Commit d6d2638acc
broke read
on zero-length files.
This commit is contained in:
parent
3d46d5502a
commit
ba6dfe0bbb
@ -2487,6 +2487,8 @@ mdb_env_read_header(MDB_env *env, MDB_meta *meta)
|
||||
memset(&ov, 0, sizeof(ov));
|
||||
ov.Offset = off;
|
||||
rc = ReadFile(env->me_fd,&pbuf,MDB_PAGESIZE,&len,&ov) ? (int)len : -1;
|
||||
if (rc == -1 && ErrCode() == ERROR_HANDLE_EOF)
|
||||
rc = 0;
|
||||
#else
|
||||
rc = pread(env->me_fd, &pbuf, MDB_PAGESIZE, off);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user