Mercurial > hg > nginx-vendor-current
comparison src/core/ngx_file.c @ 44:4989c3d25945 NGINX_0_1_22
nginx 0.1.22
*) Bugfix: the ngx_http_stub_status_module showed incorrect handled
connections statistics if the proxying or FastCGI server were used.
*) Bugfix: the installation paths were incorrectly quoted on Linux and
Solaris; bug appeared in 0.1.21.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Tue, 22 Feb 2005 00:00:00 +0300 |
parents | 41ccba1aba45 |
children | 6cfc63e68377 |
comparison
equal
deleted
inserted
replaced
43:95fe5f51bcdb | 44:4989c3d25945 |
---|---|
6 | 6 |
7 #include <ngx_config.h> | 7 #include <ngx_config.h> |
8 #include <ngx_core.h> | 8 #include <ngx_core.h> |
9 | 9 |
10 | 10 |
11 static ngx_atomic_int_t ngx_temp_number; | 11 static ngx_atomic_uint_t ngx_temp_number; |
12 static ngx_atomic_int_t ngx_random; | 12 static ngx_atomic_uint_t ngx_random; |
13 | 13 |
14 | 14 |
15 ssize_t | 15 ssize_t |
16 ngx_write_chain_to_temp_file(ngx_temp_file_t *tf, ngx_chain_t *chain) | 16 ngx_write_chain_to_temp_file(ngx_temp_file_t *tf, ngx_chain_t *chain) |
17 { | 17 { |
36 | 36 |
37 ngx_int_t | 37 ngx_int_t |
38 ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, ngx_pool_t *pool, | 38 ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, ngx_pool_t *pool, |
39 int persistent) | 39 int persistent) |
40 { | 40 { |
41 ngx_err_t err; | 41 ngx_err_t err; |
42 ngx_atomic_int_t n; | 42 ngx_atomic_uint_t n; |
43 | 43 |
44 file->name.len = path->name.len + 1 + path->len + NGX_ATOMIC_T_LEN; | 44 file->name.len = path->name.len + 1 + path->len + NGX_ATOMIC_T_LEN; |
45 | 45 |
46 if (!(file->name.data = ngx_palloc(pool, file->name.len + 1))) { | 46 if (!(file->name.data = ngx_palloc(pool, file->name.len + 1))) { |
47 return NGX_ERROR; | 47 return NGX_ERROR; |
174 ngx_temp_number = 0; | 174 ngx_temp_number = 0; |
175 ngx_random = 123456; | 175 ngx_random = 123456; |
176 } | 176 } |
177 | 177 |
178 | 178 |
179 ngx_atomic_int_t | 179 ngx_atomic_uint_t |
180 ngx_next_temp_number(ngx_uint_t collision) | 180 ngx_next_temp_number(ngx_uint_t collision) |
181 { | 181 { |
182 if (collision) { | 182 if (collision) { |
183 ngx_temp_number += ngx_random; | 183 ngx_temp_number += ngx_random; |
184 } | 184 } |