Mercurial > hg > nginx-quic
annotate src/core/ngx_shmtx.c @ 629:65bf042c0b4f release-0.3.36
nginx-0.3.36-RELEASE import
*) Feature: the ngx_http_addition_filter_module.
*) Feature: the "proxy_pass" and "fastcgi_pass" directives may be used
inside the "if" block.
*) Feature: the "proxy_ignore_client_abort" and
"fastcgi_ignore_client_abort" directives.
*) Feature: the "$request_completion" variable.
*) Feature: the ngx_http_perl_module supports the $r->request_method
and $r->remote_addr.
*) Feature: the ngx_http_ssi_module supports the "elif" command.
*) Bugfix: the "\/" string in the expression of the "if" command of the
ngx_http_ssi_module was treated incorrectly.
*) Bugfix: in the regular expressions in the "if" command of the
ngx_http_ssi_module.
*) Bugfix: if the relative path was specified in the
"client_body_temp_path", "proxy_temp_path", "fastcgi_temp_path", and
"perl_modules" directives, then the directory was used relatively to
a current path but not to a server prefix.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 05 Apr 2006 13:40:54 +0000 |
parents | 3f8a2132b93d |
children | 201d017ea470 |
rev | line source |
---|---|
611 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
4 */ | |
5 | |
6 | |
7 #include <ngx_config.h> | |
8 #include <ngx_core.h> | |
9 | |
10 | |
11 #if (NGX_HAVE_ATOMIC_OPS) | |
12 | |
13 | |
14 ngx_int_t | |
15 ngx_shmtx_create(ngx_shmtx_t *mtx, void *addr, u_char *name, ngx_log_t *log) | |
16 { | |
17 mtx->lock = addr; | |
18 | |
19 return NGX_OK; | |
20 } | |
21 | |
22 #else | |
23 | |
24 | |
25 ngx_int_t | |
26 ngx_shmtx_create(ngx_shmtx_t *mtx, void *addr, u_char *name, ngx_log_t *log) | |
27 { | |
28 if (mtx->name) { | |
29 | |
30 if (ngx_strcmp(name, mtx->name) == 0) { | |
31 mtx->name = name; | |
32 mtx->log = log; | |
33 | |
34 return NGX_OK; | |
35 } | |
36 | |
37 ngx_shmtx_destory(mtx); | |
38 } | |
39 | |
40 mtx->fd = ngx_open_file(name, NGX_FILE_RDWR, NGX_FILE_CREATE_OR_OPEN); | |
41 | |
42 if (mtx->fd == NGX_INVALID_FILE) { | |
43 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, | |
44 ngx_open_file_n " \"%s\" failed", name); | |
45 return NGX_ERROR; | |
46 } | |
47 | |
48 if (ngx_delete_file(name) == NGX_FILE_ERROR) { | |
49 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, | |
50 ngx_delete_file_n " \"%s\" failed", name); | |
51 } | |
52 | |
53 mtx->name = name; | |
54 mtx->log = log; | |
55 | |
56 return NGX_OK; | |
57 } | |
58 | |
59 | |
60 void | |
61 ngx_shmtx_destory(ngx_shmtx_t *mtx) | |
62 { | |
63 if (ngx_close_file(mtx->fd) == NGX_FILE_ERROR) { | |
64 ngx_log_error(NGX_LOG_ALERT, mtx->log, ngx_errno, | |
65 ngx_close_file_n " \"%s\" failed", mtx->name); | |
66 } | |
67 } | |
68 | |
69 | |
70 #endif |