Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow windows to detect tty types #92

Merged
merged 1 commit into from
Jan 24, 2020
Merged

allow windows to detect tty types #92

merged 1 commit into from
Jan 24, 2020

Conversation

cjihrig
Copy link
Collaborator

@cjihrig cjihrig commented Jan 24, 2020

uv_fs_fstat() fails on TTYs on Windows. This commit updates uvwasi__get_filetype_by_fd() to detect this case and map the fd to the WASI character device type.

Refs: nodejs/node#31461

uv_fs_fstat() fails on TTYs on Windows. This commit updates
uvwasi__get_filetype_by_fd() to detect this case and map
the fd to the WASI character device type.

Refs: nodejs/node#31461
Copy link
Member

@tniessen tniessen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should that only happen on Windows?

@cjihrig
Copy link
Collaborator Author

cjihrig commented Jan 24, 2020

I believe it should be Windows only.

@cjihrig cjihrig merged commit 7b5b6f9 into master Jan 24, 2020
@cjihrig cjihrig deleted the win-tty branch January 24, 2020 14:24
@tniessen
Copy link
Member

tniessen commented Jan 25, 2020

I believe it should be Windows only.

Oh, yes, I assume it is Windows only, too. My question was more aimed at: Should this be guarded by #ifdef or anything? Sorry for the imprecise question :)

@cjihrig
Copy link
Collaborator Author

cjihrig commented Jan 25, 2020

Oh I see what you mean. My thought was that it seems to be necessary on Windows, but for all other platforms it shouldn't do any harm. In this scenario, we're going to return an error, and making one last attempt at figuring out the file type.

That said, if someone PR'ed an #ifdef, I wouldn't reject it.

This was referenced Mar 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants