aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-05-11 16:16:13 +0000
committerIgor Sysoev <igor@sysoev.ru>2004-05-11 16:16:13 +0000
commitd365af4a15a86f4d3f2774b197ef417dbce8a164 (patch)
treeb7b7ef7a83d30d2e2f8ff474e4da825159281ddf /src
parent11688f8a53743e41e807aae1179a6d552d87372e (diff)
downloadnginx-d365af4a15a86f4d3f2774b197ef417dbce8a164.tar.gz
nginx-d365af4a15a86f4d3f2774b197ef417dbce8a164.zip
nginx-0.0.3-2004-05-11-20:16:13 import
Diffstat (limited to 'src')
-rw-r--r--src/core/ngx_cycle.c2
-rw-r--r--src/http/ngx_http_write_filter.c6
-rw-r--r--src/os/unix/ngx_files.h1
3 files changed, 6 insertions, 3 deletions
diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c
index bde3171ae..24e30f7b1 100644
--- a/src/core/ngx_cycle.c
+++ b/src/core/ngx_cycle.c
@@ -469,7 +469,7 @@ ngx_int_t ngx_create_pidfile(ngx_cycle_t *cycle, ngx_cycle_t *old_cycle)
file.log = cycle->log;
file.fd = ngx_open_file(file.name.data, NGX_FILE_RDWR,
- NGX_FILE_CREATE_OR_OPEN);
+ NGX_FILE_CREATE_OR_OPEN|NGX_FILE_TRUNCATE);
if (file.fd == NGX_INVALID_FILE) {
ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
diff --git a/src/http/ngx_http_write_filter.c b/src/http/ngx_http_write_filter.c
index 05675374d..1728c6459 100644
--- a/src/http/ngx_http_write_filter.c
+++ b/src/http/ngx_http_write_filter.c
@@ -143,8 +143,10 @@ int ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in)
}
if (size == 0) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- "the http output chain is empty");
+ if (!last) {
+ ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
+ "the http output chain is empty");
+ }
return NGX_OK;
}
diff --git a/src/os/unix/ngx_files.h b/src/os/unix/ngx_files.h
index afc5367a3..9fe837092 100644
--- a/src/os/unix/ngx_files.h
+++ b/src/os/unix/ngx_files.h
@@ -19,6 +19,7 @@
#define NGX_FILE_RDWR O_RDWR
#define NGX_FILE_CREATE_OR_OPEN O_CREAT
#define NGX_FILE_OPEN 0
+#define NGX_FILE_TRUNCATE O_TRUNC
#define NGX_FILE_APPEND O_APPEND