diff options
author | Igor Sysoev <igor@sysoev.ru> | 2005-10-27 15:46:13 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2005-10-27 15:46:13 +0000 |
commit | 697d1aea0c7b1525beed2911f9f32426280df8f4 (patch) | |
tree | 3c59875442d9a8114785a04003fcc3b7b059dc55 /src/os/unix | |
parent | 968b2a868ba7950b7c11c81905eeb5ed87b889f2 (diff) | |
download | nginx-release-0.3.7.tar.gz nginx-release-0.3.7.zip |
nginx-0.3.7-RELEASE importrelease-0.3.7
*) Feature: the "access_log" supports the "buffer=" parameter.
*) Bugfix: nginx could not be built on platforms different from i386,
amd64, sparc, and ppc; the bug had appeared in 0.3.2.
Diffstat (limited to 'src/os/unix')
-rw-r--r-- | src/os/unix/ngx_atomic.h | 5 | ||||
-rw-r--r-- | src/os/unix/ngx_files.h | 6 | ||||
-rw-r--r-- | src/os/unix/ngx_process_cycle.c | 21 |
3 files changed, 29 insertions, 3 deletions
diff --git a/src/os/unix/ngx_atomic.h b/src/os/unix/ngx_atomic.h index 3dfce74c4..50d6354d5 100644 --- a/src/os/unix/ngx_atomic.h +++ b/src/os/unix/ngx_atomic.h @@ -154,7 +154,7 @@ static ngx_inline ngx_atomic_uint_t ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old, ngx_atomic_uint_t set) { - if (*lock == old { + if (*lock == old) { *lock = set; return 1; } @@ -174,8 +174,9 @@ ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add) return old; } -#endif +#define ngx_memory_barrier() +#endif void ngx_spinlock(ngx_atomic_t *lock, ngx_uint_t spin); diff --git a/src/os/unix/ngx_files.h b/src/os/unix/ngx_files.h index 57f53eb0e..a361fe4cd 100644 --- a/src/os/unix/ngx_files.h +++ b/src/os/unix/ngx_files.h @@ -44,7 +44,6 @@ ngx_fd_t ngx_open_tempfile(u_char *name, ngx_uint_t persistent); ssize_t ngx_read_file(ngx_file_t *file, u_char *buf, size_t size, off_t offset); #define ngx_read_file_n "read()" - ssize_t ngx_write_file(ngx_file_t *file, u_char *buf, size_t size, off_t offset); @@ -52,6 +51,11 @@ ssize_t ngx_write_chain_to_file(ngx_file_t *file, ngx_chain_t *ce, off_t offset, ngx_pool_t *pool); +#define ngx_write_fd write +#define ngx_linefeed(p) *p++ = LF; +#define NGX_LINEFEED_SIZE 1 + + #define ngx_rename_file rename #define ngx_rename_file_n "rename" diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c index f4ec06f9b..e0f967fc0 100644 --- a/src/os/unix/ngx_process_cycle.c +++ b/src/os/unix/ngx_process_cycle.c @@ -276,6 +276,13 @@ ngx_single_process_cycle(ngx_cycle_t *cycle) ngx_process_events_and_timers(cycle); if (ngx_terminate || ngx_quit) { + + for (i = 0; ngx_modules[i]; i++) { + if (ngx_modules[i]->exit_process) { + ngx_modules[i]->exit_process(cycle); + } + } + ngx_master_exit(cycle); } @@ -623,10 +630,18 @@ ngx_reap_childs(ngx_cycle_t *cycle) static void ngx_master_exit(ngx_cycle_t *cycle) { + ngx_uint_t i; + ngx_delete_pidfile(cycle); ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exit"); + for (i = 0; ngx_modules[i]; i++) { + if (ngx_modules[i]->exit_master) { + ngx_modules[i]->exit_master(cycle); + } + } + /* * we do not destroy cycle->pool here because a signal handler * that uses cycle->log can be called at this point @@ -735,6 +750,12 @@ ngx_worker_process_cycle(ngx_cycle_t *cycle, void *data) ngx_wakeup_worker_threads(cycle); #endif + for (i = 0; ngx_modules[i]; i++) { + if (ngx_modules[i]->exit_process) { + ngx_modules[i]->exit_process(cycle); + } + } + c = cycle->connections; for (i = 0; i < cycle->connection_n; i++) { if (c[i].fd != -1 |