merge r2975:

handle Win32 ReadFile() EOF state in Unix way
This commit is contained in:
Igor Sysoev 2009-09-07 09:54:47 +00:00
parent bfb2447d15
commit 0ac11cd241

View File

@ -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) {
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;
}