move stdio fd handle checking in fd_determine_type_rights to ensure type is properly set before return#4395
move stdio fd handle checking in fd_determine_type_rights to ensure type is properly set before return#4395SneezingCactus wants to merge 2 commits intobytecodealliance:mainfrom
Conversation
…ype is properly set before return
Would you mind pointing out the source code in wasi-libc related to that?
IIUC, |
i feel it's better to revert #3694 and investigate the original issue because it was based on a broken experiment: #3686 (comment) |
|
I feel this PR is primarily about ensuring |
Before this change, fd_determine_type_rights would return early upon dealing with a stdio file handle without giving it any type (therefore being left as a __WASI_FILETYPE_UNKNOWN). This would end up having repercussions on wasi-sdk's implementation of vfprintf, which doesn't register line breaks properly if the file it's writing to (stdout in the case of printf) isn't a tty, which is mainly checked by seeing if the file is a CHARACTER_DEVICE.