diff options
author | Igor Sysoev <igor@sysoev.ru> | 2008-12-09 17:41:17 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2008-12-09 17:41:17 +0000 |
commit | a70d3962bbeec26e3d0dfc5dbe287230a533d44b (patch) | |
tree | a2e66ba6b3fe9d24e690641794c379c88f42726a /src | |
parent | c9aae14a7ebf75918bb383e7ee51eb9696e5a45c (diff) | |
download | nginx-a70d3962bbeec26e3d0dfc5dbe287230a533d44b.tar.gz nginx-a70d3962bbeec26e3d0dfc5dbe287230a533d44b.zip |
compact win32 errno logging
Diffstat (limited to 'src')
-rw-r--r-- | src/core/ngx_log.c | 12 | ||||
-rw-r--r-- | src/os/win32/ngx_gui.c | 9 |
2 files changed, 4 insertions, 17 deletions
diff --git a/src/core/ngx_log.c b/src/core/ngx_log.c index e3abcd780..cc38b02da 100644 --- a/src/core/ngx_log.c +++ b/src/core/ngx_log.c @@ -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); diff --git a/src/os/win32/ngx_gui.c b/src/os/win32/ngx_gui.c index 138d44a6b..ba6564560 100644 --- a/src/os/win32/ngx_gui.c +++ b/src/os/win32/ngx_gui.c @@ -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) { |