nginx-0.0.3-2004-03-29-21:43:58 import
diff --git a/src/core/ngx_alloc.c b/src/core/ngx_alloc.c
index 1cbd4c8..de583fc 100644
--- a/src/core/ngx_alloc.c
+++ b/src/core/ngx_alloc.c
@@ -90,8 +90,6 @@
break;
}
}
-
- pool = NULL;
}
diff --git a/src/core/ngx_atomic.h b/src/core/ngx_atomic.h
index 17362aa..311ef88 100644
--- a/src/core/ngx_atomic.h
+++ b/src/core/ngx_atomic.h
@@ -21,13 +21,14 @@
{
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 @@
{
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 @@
" 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 30a3e5f..6391867 100644
--- a/src/core/ngx_conf_file.c
+++ b/src/core/ngx_conf_file.c
@@ -556,7 +556,7 @@
" (%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 e56edc9..eb3cacb 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 b23fac6..4a6ad2e 100644
--- a/src/core/ngx_times.c
+++ b/src/core/ngx_times.c
@@ -171,7 +171,12 @@
mon += 2;
if (yday >= 306) {
- yday -= 306;
+ /*
+ * yday is not used in Win32 SYSTEMTIME
+ *
+ * yday -= 306;
+ */
+
year++;
mon -= 12;
@@ -194,12 +199,16 @@
}
}
- } 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;