Mercurial > hg > nginx
comparison src/core/ngx_file.c @ 160:e7e094d34162
nginx-0.0.1-2003-10-27-11:53:49 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 27 Oct 2003 08:53:49 +0000 |
parents | afc333135a6b |
children | c42be4185301 |
comparison
equal
deleted
inserted
replaced
159:981e4af2a425 | 160:e7e094d34162 |
---|---|
3 #include <ngx_core.h> | 3 #include <ngx_core.h> |
4 | 4 |
5 | 5 |
6 static int ngx_temp_number; | 6 static int ngx_temp_number; |
7 static int ngx_random; | 7 static int ngx_random; |
8 | |
9 | |
10 int ngx_write_chain_to_temp_file(ngx_temp_file_t *tf, ngx_chain_t *chain) | |
11 { | |
12 int rc; | |
13 | |
14 if (tf->file.fd == NGX_INVALID_FILE) { | |
15 rc = ngx_create_temp_file(&tf->file, &tf->path, tf->pool, | |
16 tf->persistent); | |
17 | |
18 if (rc == NGX_ERROR || rc == NGX_AGAIN) { | |
19 return rc; | |
20 } | |
21 | |
22 if (!tf->persistent && tf->warn) { | |
23 ngx_log_error(NGX_LOG_WARN, tf->file.log, 0, tf->warn); | |
24 } | |
25 } | |
26 | |
27 return ngx_write_chain_to_file(&tf->file, chain, tf->file.offset, tf->pool); | |
28 } | |
8 | 29 |
9 | 30 |
10 int ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, | 31 int ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, |
11 ngx_pool_t *pool, int persistent) | 32 ngx_pool_t *pool, int persistent) |
12 { | 33 { |