ext/libuv/src/uv-common.c in libuv-2.0.5 vs ext/libuv/src/uv-common.c in libuv-2.0.6
- old
+ new
@@ -139,15 +139,11 @@
static const char* uv__unknown_err_code(int err) {
char buf[32];
char* copy;
-#ifndef _WIN32
snprintf(buf, sizeof(buf), "Unknown system error %d", err);
-#else
- _snprintf(buf, sizeof(buf), "Unknown system error %d", err);
-#endif
copy = uv__strdup(buf);
return copy != NULL ? copy : "Unknown system error";
}
@@ -339,14 +335,21 @@
return uv__udp_recv_stop(handle);
}
void uv_walk(uv_loop_t* loop, uv_walk_cb walk_cb, void* arg) {
+ QUEUE queue;
QUEUE* q;
uv_handle_t* h;
- QUEUE_FOREACH(q, &loop->handle_queue) {
+ QUEUE_MOVE(&loop->handle_queue, &queue);
+ while (!QUEUE_EMPTY(&queue)) {
+ q = QUEUE_HEAD(&queue);
h = QUEUE_DATA(q, uv_handle_t, handle_queue);
+
+ QUEUE_REMOVE(q);
+ QUEUE_INSERT_TAIL(&loop->handle_queue, q);
+
if (h->flags & UV__HANDLE_INTERNAL) continue;
walk_cb(h, arg);
}
}