]> git.kaiwu.me - nginx.git/commitdiff
compact win32 errno logging
authorIgor Sysoev <igor@sysoev.ru>
Tue, 9 Dec 2008 17:41:17 +0000 (17:41 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Tue, 9 Dec 2008 17:41:17 +0000 (17:41 +0000)
src/core/ngx_log.c
src/os/win32/ngx_gui.c

index e3abcd780fea1e8ba5044168a44148ec2997b60e..cc38b02da1d60a678d948ea7eb67a86b65a3879c 100644 (file)
@@ -127,18 +127,10 @@ ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
         }
 
 #if (NGX_WIN32)
-
-        if ((unsigned) err >= 0x80000000) {
-            p = ngx_snprintf(p, last - p, " (%Xd: ", err);
-
-        } else {
-            p = ngx_snprintf(p, last - p, " (%d: ", err);
-        }
-
+        p = ngx_snprintf(p, last - p, ((unsigned) err < 0x80000000)
+                                           ? " (%d: " : " (%Xd: ", err);
 #else
-
         p = ngx_snprintf(p, last - p, " (%d: ", err);
-
 #endif
 
         p = ngx_strerror_r(err, p, last - p);
index 138d44a6b02a74d618fdf13125466611f8eb3653..ba6564560c9516c99137d2340a4e62c6f11c92d1 100644 (file)
@@ -36,13 +36,8 @@ ngx_message_box(char *title, ngx_uint_t type, ngx_err_t err,
             *p++ = '.';
         }
 
-        if ((unsigned) err >= 0x80000000) {
-            p = ngx_snprintf(p, last - p, " (%Xd: ", err);
-
-        } else {
-            p = ngx_snprintf(p, last - p, " (%d: ", err);
-        }
-
+        p = ngx_snprintf(p, last - p, ((unsigned) err < 0x80000000)
+                                           ? " (%d: " : " (%Xd: ", err);
         p = ngx_strerror_r(err, p, last - p);
 
         if (p < last) {