diff src/core/ngx_file.c @ 282:675a39fd14cd NGINX_0_5_11

nginx 0.5.11 *) Feature: now configure detects system PCRE library in MacPorts. Thanks to Chris McGrath. *) Bugfix: the response was incorrect if several ranges were requested; bug appeared in 0.5.6. *) Bugfix: the "create_full_put_path" directive could not create the intermediate directories if no "dav_access" directive was set. Thanks to Evan Miller. *) Bugfix: the "0" response code might be logged in the access_log instead of the "400" and "408" error codes. *) Bugfix: a segmentation fault might occur in worker process if nginx was built with -O2 optimization.
author Igor Sysoev <http://sysoev.ru>
date Mon, 05 Feb 2007 00:00:00 +0300
parents 704622b2528a
children fc223117327f
line wrap: on
line diff
--- a/src/core/ngx_file.c
+++ b/src/core/ngx_file.c
@@ -39,12 +39,12 @@ ngx_int_t
 ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, ngx_pool_t *pool,
     ngx_uint_t persistent, ngx_uint_t clean, ngx_uint_t access)
 {
+    uint32_t                  n;
     ngx_err_t                 err;
-    ngx_atomic_uint_t         n;
     ngx_pool_cleanup_t       *cln;
     ngx_pool_cleanup_file_t  *clnf;
 
-    file->name.len = path->name.len + 1 + path->len + NGX_ATOMIC_T_LEN;
+    file->name.len = path->name.len + 1 + path->len + 10;
 
     file->name.data = ngx_palloc(pool, file->name.len + 1);
     if (file->name.data == NULL) {
@@ -59,11 +59,11 @@ ngx_create_temp_file(ngx_file_t *file, n
 
     ngx_memcpy(file->name.data, path->name.data, path->name.len);
 
-    n = ngx_next_temp_number(0);
+    n = (uint32_t) ngx_next_temp_number(0);
 
     for ( ;; ) {
         (void) ngx_sprintf(file->name.data + path->name.len + 1 + path->len,
-                           "%0muA%Z", n);
+                           "%010uD%Z", n);
 
         ngx_create_hashed_filename(file, path);
 
@@ -92,7 +92,7 @@ ngx_create_temp_file(ngx_file_t *file, n
         err = ngx_errno;
 
         if (err == NGX_EEXIST) {
-            n = ngx_next_temp_number(1);
+            n = (uint32_t) ngx_next_temp_number(1);
             continue;
         }