nginx-0.0.7-2004-07-14-20:01:42 import
diff --git a/src/os/unix/ngx_freebsd_init.c b/src/os/unix/ngx_freebsd_init.c
index 5addd26..6e7db85 100644
--- a/src/os/unix/ngx_freebsd_init.c
+++ b/src/os/unix/ngx_freebsd_init.c
@@ -84,7 +84,7 @@
     size = sizeof(ngx_freebsd_kern_ostype);
     if (sysctlbyname("kern.ostype",
                      ngx_freebsd_kern_ostype, &size, NULL, 0) == -1) {
-        ngx_log_error(NGX_LOG_ALERT, log, errno,
+        ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
                       "sysctlbyname(kern.ostype) failed");
         return NGX_ERROR;
     }
@@ -92,7 +92,7 @@
     size = sizeof(ngx_freebsd_kern_osrelease);
     if (sysctlbyname("kern.osrelease",
                      ngx_freebsd_kern_osrelease, &size, NULL, 0) == -1) {
-        ngx_log_error(NGX_LOG_ALERT, log, errno,
+        ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
                       "sysctlbyname(kern.osrelease) failed");
         return NGX_ERROR;
     }
@@ -104,7 +104,7 @@
     size = sizeof(int);
     if (sysctlbyname("kern.osreldate",
                      &ngx_freebsd_kern_osreldate, &size, NULL, 0) == -1) {
-        ngx_log_error(NGX_LOG_ALERT, log, errno,
+        ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
                       "sysctlbyname(kern.osreldate) failed");
         return NGX_ERROR;
     }
@@ -169,7 +169,7 @@
         size = sysctls[i].size;
         if (sysctlbyname(sysctls[i].name, sysctls[i].value, &size, NULL, 0)
                                                                        == -1) {
-            err = errno;
+            err = ngx_errno;
             if (err != NGX_ENOENT) {
                 if (sysctls[i].value == &ngx_freebsd_machdep_hlt_logical_cpus) {
                     continue;