Skip to content

Commit 422a981

Browse files
cjihrigjuanarbol
authored andcommitted
deps: update to uvwasi 0.0.14
Notable changes: - Windows applications not in ConsoleMode now properly guess handle types for FILE_TYPE_CHAR file types which cannot be stat'ed. - The UVWASI_DEBUG macro can now be used without a format string. - The libuv dependency has been updated to v1.44.2. PR-URL: #45970 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
1 parent d31c478 commit 422a981

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

deps/uvwasi/include/uvwasi.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ extern "C" {
1010

1111
#define UVWASI_VERSION_MAJOR 0
1212
#define UVWASI_VERSION_MINOR 0
13-
#define UVWASI_VERSION_PATCH 13
13+
#define UVWASI_VERSION_PATCH 14
1414
#define UVWASI_VERSION_HEX ((UVWASI_VERSION_MAJOR << 16) | \
1515
(UVWASI_VERSION_MINOR << 8) | \
1616
(UVWASI_VERSION_PATCH))

deps/uvwasi/src/debug.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
# define __STDC_FORMAT_MACROS
77
#endif
88
# include <inttypes.h>
9-
# define UVWASI_DEBUG(fmt, ...) \
10-
do { fprintf(stderr, fmt, __VA_ARGS__); } while (0)
9+
# define UVWASI_DEBUG(...) \
10+
do { fprintf(stderr, __VA_ARGS__); } while (0)
1111
#else
1212
# define UVWASI_DEBUG(fmt, ...)
1313
#endif

deps/uvwasi/src/uv_mapping.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,13 @@ uvwasi_errno_t uvwasi__get_filetype_by_fd(uv_file fd, uvwasi_filetype_t* type) {
251251
if (r != 0) {
252252
uv_fs_req_cleanup(&req);
253253

254-
/* Windows can't stat a TTY. */
255-
if (uv_guess_handle(fd) == UV_TTY) {
254+
uv_handle_type guess;
255+
/*
256+
Windows can't stat a FILE_TYPE_CHAR, which is guessed
257+
as UV_TTY in "ConsoleMode" or UV_FILE otherwise.
258+
*/
259+
guess = uv_guess_handle(fd);
260+
if (guess == UV_TTY || guess == UV_FILE) {
256261
*type = UVWASI_FILETYPE_CHARACTER_DEVICE;
257262
return UVWASI_ESUCCESS;
258263
}

0 commit comments

Comments
 (0)