From 74b0b940b694b1c89c1b03fc0e05155318538d66 Mon Sep 17 00:00:00 2001 From: Kirill A. Korinskiy Date: Fri, 17 Apr 2009 19:26:33 +0400 Subject: [PATCH] Stop write log after have a problems for write(3). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: catap@catap.ru Now we have a some issue — the I/O is a sync operation and we blocking every time to try write to full partition. This patch stop write a log after first problem. --- src/core/ngx_log.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/core/ngx_log.c b/src/core/ngx_log.c index f1718f18577a9beed2955e7fbb3f6403566f4ff7..6829d77a973e97a3965e61b12a90a6dca478a894 100644 --- a/src/core/ngx_log.c +++ b/src/core/ngx_log.c @@ -150,7 +150,10 @@ ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err, ngx_linefeed(p); - (void) ngx_write_fd(log->file->fd, errstr, p - errstr); + if (ngx_write_fd(log->file->fd, errstr, p - errstr) + == -1) { + log->file->fd = NGX_INVALID_FILE; + } } -- 1.6.2