From d6b442b8d4146f0642d4251be6f4b78188594fa6 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 7 Sep 2009 09:54:47 +0000 Subject: [PATCH] merge r2975: handle Win32 ReadFile() EOF state in Unix way --- src/os/win32/ngx_files.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/os/win32/ngx_files.c b/src/os/win32/ngx_files.c index b6f9bb645..c74ec5886 100644 --- a/src/os/win32/ngx_files.c +++ b/src/os/win32/ngx_files.c @@ -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; }