diff src/core/nginx.c @ 418:ff86d646f9df NGINX_0_7_21

nginx 0.7.21 *) Changes in the ngx_http_limit_req_module. *) Feature: the EXSLT support in the ngx_http_xslt_module. Thanks to Denis F. Latypoff. *) Workaround: compatibility with glibc 2.3. Thanks to Eric Benson and Maxim Dounin. *) Bugfix: nginx could not run on MacOSX 10.4 and earlier; the bug had appeared in 0.7.6.
author Igor Sysoev <http://sysoev.ru>
date Tue, 11 Nov 2008 00:00:00 +0300
parents 79c5df00501e
children a8424ffa495c
line wrap: on
line diff
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -191,6 +191,8 @@ static char **ngx_os_environ;
 int ngx_cdecl
 main(int argc, char *const *argv)
 {
+    char             *p;
+    ssize_t           n;
     ngx_int_t         i;
     ngx_log_t        *log;
     ngx_cycle_t      *cycle, init_cycle;
@@ -240,23 +242,30 @@ main(int argc, char *const *argv)
     }
 
     if (ngx_show_version) {
-        ngx_write_fd(ngx_stderr_fileno, "nginx version: " NGINX_VER CRLF,
-                     sizeof("nginx version: " NGINX_VER CRLF) - 1);
+
+        p = "nginx version: " NGINX_VER CRLF;
+        n = sizeof("nginx version: " NGINX_VER CRLF) - 1;
+
+        if (ngx_write_fd(ngx_stderr_fileno, p, n) != n) {
+            return 1;
+        }
 
         if (ngx_show_configure) {
 #ifdef NGX_COMPILER
-            ngx_write_fd(ngx_stderr_fileno, "built by " NGX_COMPILER CRLF,
-                         sizeof("built by " NGX_COMPILER CRLF) - 1);
+            p = "built by " NGX_COMPILER CRLF;
+            n = sizeof("built by " NGX_COMPILER CRLF) - 1;
+
+            if (ngx_write_fd(ngx_stderr_fileno, p, n) != n) {
+                return 1;
+            }
 #endif
 
-#ifndef __WATCOMC__
-
-            /* OpenWatcomC could not build the long NGX_CONFIGURE string */
+            p = "configure arguments: " NGX_CONFIGURE CRLF;
+            n = sizeof("configure arguments :" NGX_CONFIGURE CRLF) - 1;
 
-            ngx_write_fd(ngx_stderr_fileno,
-                        "configure arguments: " NGX_CONFIGURE CRLF,
-                        sizeof("configure arguments :" NGX_CONFIGURE CRLF) - 1);
-#endif
+            if (ngx_write_fd(ngx_stderr_fileno, p, n) != n) {
+                return 1;
+            }
         }
 
         if (!ngx_test_config) {