diff --git a/include/uv-private/ngx-queue.h b/include/uv-private/ngx-queue.h index 7058ce40..6fd0071f 100644 --- a/include/uv-private/ngx-queue.h +++ b/include/uv-private/ngx-queue.h @@ -100,7 +100,9 @@ struct ngx_queue_s { #define ngx_queue_foreach(q, h) \ - for ((q) = ngx_queue_head(h); (q) != (h); (q) = ngx_queue_next(q)) + for ((q) = ngx_queue_head(h); \ + (q) != ngx_queue_sentinel(h); \ + (q) = ngx_queue_next(q)) #endif /* NGX_QUEUE_H_INCLUDED_ */