Mercurial > hg > nginx
comparison src/core/ngx_file.c @ 3202:121fae8c673c
ignore EACCES errors for top level directories in ngx_create_full_path()
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 14 Oct 2009 11:46:09 +0000 |
parents | 5fae6f9085e1 |
children | 6be1f25bae90 |
comparison
equal
deleted
inserted
replaced
3201:5fae6f9085e1 | 3202:121fae8c673c |
---|---|
181 ngx_create_full_path(u_char *dir, ngx_uint_t access) | 181 ngx_create_full_path(u_char *dir, ngx_uint_t access) |
182 { | 182 { |
183 u_char *p, ch; | 183 u_char *p, ch; |
184 ngx_err_t err; | 184 ngx_err_t err; |
185 | 185 |
186 err = 0; | |
187 | |
186 #if (NGX_WIN32) | 188 #if (NGX_WIN32) |
187 p = dir + 3; | 189 p = dir + 3; |
188 #else | 190 #else |
189 p = dir + 1; | 191 p = dir + 1; |
190 #endif | 192 #endif |
198 | 200 |
199 *p = '\0'; | 201 *p = '\0'; |
200 | 202 |
201 if (ngx_create_dir(dir, access) == NGX_FILE_ERROR) { | 203 if (ngx_create_dir(dir, access) == NGX_FILE_ERROR) { |
202 err = ngx_errno; | 204 err = ngx_errno; |
203 if (err != NGX_EEXIST) { | 205 |
206 switch (err) { | |
207 case NGX_EEXIST: | |
208 err = 0; | |
209 case NGX_EACCES: | |
210 break; | |
211 | |
212 default: | |
204 return err; | 213 return err; |
205 } | 214 } |
206 } | 215 } |
207 | 216 |
208 *p = '/'; | 217 *p = '/'; |
209 } | 218 } |
210 | 219 |
211 return 0; | 220 return err; |
212 } | 221 } |
213 | 222 |
214 | 223 |
215 ngx_atomic_uint_t | 224 ngx_atomic_uint_t |
216 ngx_next_temp_number(ngx_uint_t collision) | 225 ngx_next_temp_number(ngx_uint_t collision) |