nginx-0.7.20

Igor Sysoev is at rambler-co.ru
Tue Nov 11 19:55:00 MSK 2008


On Tue, Nov 11, 2008 at 05:50:04PM +0100, Thomas wrote:

> Thank you for your responsiveness. I applied the patch, and now during
> compilation I get the following error message:
> --
>         -o objs/src/os/unix/ngx_darwin_init.o \
>         src/os/unix/ngx_darwin_init.c
> src/os/unix/ngx_darwin_init.c: In function 'ngx_os_specific_init':
> src/os/unix/ngx_darwin_init.c:75: error: 'NGX_NOENT' undeclared (first
> use in this function)
> src/os/unix/ngx_darwin_init.c:75: error: (Each undeclared identifier
> is reported only once
> src/os/unix/ngx_darwin_init.c:75: error: for each function it appears in.)
> make[1]: *** [objs/src/os/unix/ngx_darwin_init.o] Error 1
> make: *** [build] Error 2
> --

Sorry, the new patch.


-- 
Igor Sysoev
http://sysoev.ru/en/
-------------- next part --------------
Index: src/os/unix/ngx_darwin_init.c
===================================================================
--- src/os/unix/ngx_darwin_init.c	(revision 1621)
+++ src/os/unix/ngx_darwin_init.c	(working copy)
@@ -64,32 +64,44 @@
     ngx_uint_t  i;
 
     size = sizeof(ngx_darwin_kern_ostype);
-    if (sysctlbyname("kern.ostype",
-                     ngx_darwin_kern_ostype, &size, NULL, 0) == -1) {
-        ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
+    if (sysctlbyname("kern.ostype", ngx_darwin_kern_ostype, &size, NULL, 0)
+        == -1)
+    {
+        err = ngx_errno;
+
+        ngx_log_error(NGX_LOG_ALERT, log, err,
                       "sysctlbyname(kern.ostype) failed");
 
-        if (ngx_errno != NGX_ENOMEM) {
-            return NGX_ERROR;
+        if (err != NGX_ENOENT) {
+
+            if (err != NGX_ENOMEM) {
+                return NGX_ERROR;
+            }
+
+            ngx_darwin_kern_ostype[size - 1] = '\0';
         }
-
-        ngx_darwin_kern_ostype[size - 1] = '\0';
     }
 
     size = sizeof(ngx_darwin_kern_osrelease);
-    if (sysctlbyname("kern.osrelease",
-                     ngx_darwin_kern_osrelease, &size, NULL, 0) == -1) {
-        ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
+    if (sysctlbyname("kern.osrelease", ngx_darwin_kern_osrelease, &size,
+                     NULL, 0)
+        == -1)
+    {
+        err = ngx_errno;
+
+        ngx_log_error(NGX_LOG_ALERT, log, err,
                       "sysctlbyname(kern.osrelease) failed");
 
-        if (ngx_errno != NGX_ENOMEM) {
-            return NGX_ERROR;
+        if (err != NGX_ENOENT) {
+
+            if (err != NGX_ENOMEM) {
+                return NGX_ERROR;
+            }
+
+            ngx_darwin_kern_osrelease[size - 1] = '\0';
         }
-
-        ngx_darwin_kern_osrelease[size - 1] = '\0';
     }
 
-
     for (i = 0; sysctls[i].name; i++) {
         size = sysctls[i].size;
 
@@ -136,8 +148,10 @@
     u_long      value;
     ngx_uint_t  i;
 
-    ngx_log_error(NGX_LOG_NOTICE, log, 0, "OS: %s %s",
-                  ngx_darwin_kern_ostype, ngx_darwin_kern_osrelease);
+    if (ngx_darwin_kern_ostype[0]) {
+        ngx_log_error(NGX_LOG_NOTICE, log, 0, "OS: %s %s",
+                      ngx_darwin_kern_ostype, ngx_darwin_kern_osrelease);
+    }
 
     for (i = 0; sysctls[i].name; i++) {
         if (sysctls[i].exists) {


More information about the nginx mailing list