diff options
author | Igor Sysoev <igor@sysoev.ru> | 2004-03-29 17:43:58 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2004-03-29 17:43:58 +0000 |
commit | 11dbe97ca401221313dc233aa2d6f67dfcaef1a7 (patch) | |
tree | fcd53429592c68f6fdf8d3ad4b0c151b9ebd5ff3 /src/core | |
parent | 14f02ed0dde2ee19da75cd836daf76505d7f2e9c (diff) | |
download | nginx-11dbe97ca401221313dc233aa2d6f67dfcaef1a7.tar.gz nginx-11dbe97ca401221313dc233aa2d6f67dfcaef1a7.zip |
nginx-0.0.3-2004-03-29-21:43:58 import
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/ngx_alloc.c | 2 | ||||
-rw-r--r-- | src/core/ngx_atomic.h | 12 | ||||
-rw-r--r-- | src/core/ngx_conf_file.c | 2 | ||||
-rw-r--r-- | src/core/ngx_config.h | 12 | ||||
-rw-r--r-- | src/core/ngx_times.c | 23 |
5 files changed, 33 insertions, 18 deletions
diff --git a/src/core/ngx_alloc.c b/src/core/ngx_alloc.c index 1cbd4c8c8..de583fc09 100644 --- a/src/core/ngx_alloc.c +++ b/src/core/ngx_alloc.c @@ -90,8 +90,6 @@ void ngx_destroy_pool(ngx_pool_t *pool) break; } } - - pool = NULL; } diff --git a/src/core/ngx_atomic.h b/src/core/ngx_atomic.h index 17362aa32..311ef8892 100644 --- a/src/core/ngx_atomic.h +++ b/src/core/ngx_atomic.h @@ -21,13 +21,14 @@ static ngx_inline uint32_t ngx_atomic_inc(ngx_atomic_t *value) { uint32_t old; + old = 1; + __asm__ volatile ( - " movl $1, %0; " NGX_SMP_LOCK " xaddl %0, %1; " - : "=a" (old) : "m" (*value)); + : "=q" (old) : "m" (*value)); return old; } @@ -37,13 +38,14 @@ static ngx_inline uint32_t ngx_atomic_dec(ngx_atomic_t *value) { uint32_t old; + old = (uint32_t) -1; + __asm__ volatile ( - " movl $-1, %0; " NGX_SMP_LOCK " xaddl %0, %1; " - : "=a" (old) : "m" (*value)); + : "=q" (old) : "m" (*value)); return old; } @@ -62,7 +64,7 @@ static ngx_inline uint32_t ngx_atomic_cmp_set(ngx_atomic_t *lock, " setz %%al; " " movzbl %%al, %0; " - : "=a" (res) : "m" (*lock), "a" (old), "q" (set)); + : "+a" (res) : "m" (*lock), "a" (old), "q" (set)); return res; } diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c index 30a3e5f94..63918673c 100644 --- a/src/core/ngx_conf_file.c +++ b/src/core/ngx_conf_file.c @@ -556,7 +556,7 @@ void ngx_conf_log_error(ngx_uint_t level, ngx_conf_t *cf, ngx_err_t err, " (%d: ", err); len += ngx_strerror_r(err, errstr + len, sizeof(errstr) - len - 1); errstr[len++] = ')'; - errstr[len++] = '\0'; + errstr[len] = '\0'; } ngx_log_error(level, cf->log, 0, "%s in %s:%d", diff --git a/src/core/ngx_config.h b/src/core/ngx_config.h index e56edc9ac..eb3cacbe8 100644 --- a/src/core/ngx_config.h +++ b/src/core/ngx_config.h @@ -9,16 +9,22 @@ #endif -#if defined __FreeBSD__ +#if defined __DragonFly__ && !defined(__FreeBSD__) +#define __FreeBSD__ 4 +#define __FreeBSD_version 480101 +#endif + + +#if defined (__FreeBSD__) #include <ngx_freebsd_config.h> -#elif defined __linux__ +#elif defined (__linux__) #include <ngx_linux_config.h> /* Solaris */ -#elif defined(sun) && (defined(__svr4__) || defined(__SVR4)) +#elif defined (sun) && (defined (__svr4__) || defined (__SVR4)) #include <ngx_solaris_config.h> diff --git a/src/core/ngx_times.c b/src/core/ngx_times.c index b23fac61e..4a6ad2ef3 100644 --- a/src/core/ngx_times.c +++ b/src/core/ngx_times.c @@ -171,7 +171,12 @@ void ngx_gmtime(time_t t, ngx_tm_t *tp) mon += 2; if (yday >= 306) { - yday -= 306; + /* + * yday is not used in Win32 SYSTEMTIME + * + * yday -= 306; + */ + year++; mon -= 12; @@ -194,12 +199,16 @@ void ngx_gmtime(time_t t, ngx_tm_t *tp) } } - } else { - yday += 31 + 28; - - if ((year % 4 == 0) && (year % 100 || (year % 400 == 0))) { - yday++; - } +/* + * yday is not used in Win32 SYSTEMTIME + * + * } else { + * yday += 31 + 28; + * + * if ((year % 4 == 0) && (year % 100 || (year % 400 == 0))) { + * yday++; + * } + */ } tp->ngx_tm_sec = (ngx_tm_sec_t) sec; |