summaryrefslogtreecommitdiff
path: root/src/core/ngx_output_chain.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/ngx_output_chain.c')
-rw-r--r--src/core/ngx_output_chain.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/core/ngx_output_chain.c b/src/core/ngx_output_chain.c
index 6d6d241c1..808addd85 100644
--- a/src/core/ngx_output_chain.c
+++ b/src/core/ngx_output_chain.c
@@ -510,7 +510,7 @@ ngx_output_chain_copy_buf(ngx_output_chain_ctx_t *ctx)
#if (NGX_HAVE_ALIGNED_DIRECTIO)
if (ctx->unaligned) {
- if (ngx_directio_off(src->file->fd) == -1) {
+ if (ngx_directio_off(src->file->fd) == NGX_FILE_ERROR) {
ngx_log_error(NGX_LOG_ALERT, ctx->pool->log, ngx_errno,
ngx_directio_off_n " \"%s\" failed",
src->file->name.data);
@@ -528,7 +528,7 @@ ngx_output_chain_copy_buf(ngx_output_chain_ctx_t *ctx)
err = ngx_errno;
- if (ngx_directio_on(src->file->fd) == -1) {
+ if (ngx_directio_on(src->file->fd) == NGX_FILE_ERROR) {
ngx_log_error(NGX_LOG_ALERT, ctx->pool->log, ngx_errno,
ngx_directio_on_n " \"%s\" failed",
src->file->name.data);
@@ -555,9 +555,7 @@ ngx_output_chain_copy_buf(ngx_output_chain_ctx_t *ctx)
ngx_log_error(NGX_LOG_ALERT, ctx->pool->log, 0,
ngx_read_file_n " read only %z of %O from \"%s\"",
n, size, src->file->name.data);
- if (n == 0) {
- return NGX_ERROR;
- }
+ return NGX_ERROR;
}
dst->last += n;