Mmap does not fail on zero-length files.

This commit is contained in:
Bertho Stultiens 2000-05-03 17:35:10 +00:00 committed by Alexandre Julliard
parent 72eb8d39d4
commit 5b8eb2d838
1 changed files with 1 additions and 0 deletions

View File

@ -1063,6 +1063,7 @@ static int NativeRegLoadKey( HKEY hkey, char* fn, int level )
/* map the registry into the memory */
if ((fd = open(full_name.long_name, O_RDONLY | O_NONBLOCK)) == -1) return FALSE;
if ((fstat(fd, &st) == -1)) goto error;
if (!st.st_size) goto error;
if ((base = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0)) == MAP_FAILED) goto error;
switch (*(LPDWORD)base)