handle Win32 ReadFile() EOF state in Unix way
This commit is contained in:
parent
c49fd6f714
commit
6b5ecddc08
1 changed files with 7 additions and 1 deletions
|
@ -95,7 +95,13 @@ ngx_read_file(ngx_file_t *file, u_char *buf, size_t size, off_t offset)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ReadFile(file->fd, buf, size, &n, povlp) == 0) {
|
if (ReadFile(file->fd, buf, size, &n, povlp) == 0) {
|
||||||
ngx_log_error(NGX_LOG_ERR, file->log, ngx_errno, "ReadFile() failed");
|
err = ngx_errno;
|
||||||
|
|
||||||
|
if (err == ERROR_HANDLE_EOF) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ngx_log_error(NGX_LOG_ERR, file->log, err, "ReadFile() failed");
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue