diff --git a/include/uv.h b/include/uv.h index 564af5fa..82afbee2 100644 --- a/include/uv.h +++ b/include/uv.h @@ -406,7 +406,10 @@ struct uv_shutdown_s { /* private */ \ uv_close_cb close_cb; \ void* handle_queue[2]; \ - void* reserved[4]; \ + union { \ + int fd; \ + void* reserved[4]; \ + } u; \ UV_HANDLE_PRIVATE_FIELDS \ /* The abstract base class of all handles. */ diff --git a/src/uv-common.h b/src/uv-common.h index 8258d7a1..b348ec76 100644 --- a/src/uv-common.h +++ b/src/uv-common.h @@ -196,7 +196,7 @@ void uv__fs_scandir_cleanup(uv_fs_t* req); (((h)->flags & UV__HANDLE_REF) != 0) #if defined(_WIN32) -# define uv__handle_platform_init(h) +# define uv__handle_platform_init(h) ((h)->u.fd = -1) #else # define uv__handle_platform_init(h) ((h)->next_closing = NULL) #endif