comparison src/core/ngx_shmtx.c @ 680:597573166f34 NGINX_1_3_3

nginx 1.3.3 *) Feature: entity tags support and the "etag" directive. *) Bugfix: trailing dot in a source value was not ignored if the "map" directive was used with the "hostnames" parameter. *) Bugfix: incorrect location might be used to process a request if a URI was changed via a "rewrite" directive before an internal redirect to a named location.
author Igor Sysoev <http://sysoev.ru>
date Tue, 10 Jul 2012 00:00:00 +0400
parents d0f7a625f27c
children 6db6e93f55ee
comparison
equal deleted inserted replaced
679:cad34cec7d3b 680:597573166f34
42 return NGX_OK; 42 return NGX_OK;
43 } 43 }
44 44
45 45
46 void 46 void
47 ngx_shmtx_destory(ngx_shmtx_t *mtx) 47 ngx_shmtx_destroy(ngx_shmtx_t *mtx)
48 { 48 {
49 #if (NGX_HAVE_POSIX_SEM) 49 #if (NGX_HAVE_POSIX_SEM)
50 50
51 if (mtx->semaphore) { 51 if (mtx->semaphore) {
52 if (sem_destroy(&mtx->sem) == -1) { 52 if (sem_destroy(&mtx->sem) == -1) {
206 if (ngx_strcmp(name, mtx->name) == 0) { 206 if (ngx_strcmp(name, mtx->name) == 0) {
207 mtx->name = name; 207 mtx->name = name;
208 return NGX_OK; 208 return NGX_OK;
209 } 209 }
210 210
211 ngx_shmtx_destory(mtx); 211 ngx_shmtx_destroy(mtx);
212 } 212 }
213 213
214 mtx->fd = ngx_open_file(name, NGX_FILE_RDWR, NGX_FILE_CREATE_OR_OPEN, 214 mtx->fd = ngx_open_file(name, NGX_FILE_RDWR, NGX_FILE_CREATE_OR_OPEN,
215 NGX_FILE_DEFAULT_ACCESS); 215 NGX_FILE_DEFAULT_ACCESS);
216 216
230 return NGX_OK; 230 return NGX_OK;
231 } 231 }
232 232
233 233
234 void 234 void
235 ngx_shmtx_destory(ngx_shmtx_t *mtx) 235 ngx_shmtx_destroy(ngx_shmtx_t *mtx)
236 { 236 {
237 if (ngx_close_file(mtx->fd) == NGX_FILE_ERROR) { 237 if (ngx_close_file(mtx->fd) == NGX_FILE_ERROR) {
238 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, ngx_errno, 238 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, ngx_errno,
239 ngx_close_file_n " \"%s\" failed", mtx->name); 239 ngx_close_file_n " \"%s\" failed", mtx->name);
240 } 240 }