comparison src/core/ngx_file.c @ 495:fc9909c369b2 release-0.1.22

nginx-0.1.22-RELEASE import *) 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; the bug had appeared in 0.1.21.
author Igor Sysoev <igor@sysoev.ru>
date Thu, 24 Feb 2005 12:29:09 +0000
parents 975f62e77f02
children 64d9afb209da
comparison
equal deleted inserted replaced
494:f94c1b769a7c 495:fc9909c369b2
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 }