diff src/event/modules/ngx_kqueue_module.c @ 6479:dc92298b1852

Events: fixed logging.
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 31 Mar 2016 02:33:55 +0300
parents 4652f8f26b12
children a72886067bbb
line wrap: on
line diff
--- a/src/event/modules/ngx_kqueue_module.c
+++ b/src/event/modules/ngx_kqueue_module.c
@@ -579,7 +579,7 @@ ngx_kqueue_process_events(ngx_cycle_t *c
         if (event_list[i].flags & EV_ERROR) {
             ngx_log_error(NGX_LOG_ALERT, cycle->log, event_list[i].data,
                           "kevent() error on %d filter:%d flags:%04Xd",
-                          event_list[i].ident, event_list[i].filter,
+                          (int) event_list[i].ident, event_list[i].filter,
                           event_list[i].flags);
             continue;
         }
@@ -676,13 +676,20 @@ ngx_kqueue_process_events(ngx_cycle_t *c
 static ngx_inline void
 ngx_kqueue_dump_event(ngx_log_t *log, struct kevent *kev)
 {
-    ngx_log_debug6(NGX_LOG_DEBUG_EVENT, log, 0,
-                   (kev->ident > 0x8000000 && kev->ident != (unsigned) -1) ?
-                    "kevent: %p: ft:%d fl:%04Xd ff:%08Xd d:%d ud:%p":
-                    "kevent: %d: ft:%d fl:%04Xd ff:%08Xd d:%d ud:%p",
-                    kev->ident, kev->filter,
-                    kev->flags, kev->fflags,
-                    kev->data, kev->udata);
+    if (kev->ident > 0x8000000 && kev->ident != (unsigned) -1) {
+        ngx_log_debug6(NGX_LOG_DEBUG_EVENT, log, 0,
+                       "kevent: %p: ft:%d fl:%04Xd ff:%08Xd d:%d ud:%p",
+                       (void *) kev->ident, kev->filter,
+                       kev->flags, kev->fflags,
+                       (int) kev->data, kev->udata);
+
+    } else {
+        ngx_log_debug6(NGX_LOG_DEBUG_EVENT, log, 0,
+                       "kevent: %d: ft:%d fl:%04Xd ff:%08Xd d:%d ud:%p",
+                       (int) kev->ident, kev->filter,
+                       kev->flags, kev->fflags,
+                       (int) kev->data, kev->udata);
+    }
 }