]> git.lizzy.rs Git - rust.git/commit - src/tools/rust-analyzer
Rollup merge of #89433 - arlosi:stdin-fix, r=joshtriplett
authorMatthias Krüger <matthias.krueger@famsik.de>
Thu, 14 Oct 2021 14:06:44 +0000 (16:06 +0200)
committerGitHub <noreply@github.com>
Thu, 14 Oct 2021 14:06:44 +0000 (16:06 +0200)
commitd1777917915f59df0407ddeb16aa9e987481784c
tree024d7358ba4bd36b0c19c184f3f971d257f7c5f9
parentf9c9774aea914bc2be7ad1bb466a8104592a7933
parent273e522af6c7b28704688b2a7b8b423c7472fb3c
Rollup merge of #89433 - arlosi:stdin-fix, r=joshtriplett

Fix ctrl-c causing reads of stdin to return empty on Windows.

Pressing ctrl+c (or ctrl+break) on Windows caused a blocking read of stdin to unblock and return empty, unlike other platforms which continue to block.

On ctrl-c, `ReadConsoleW` will return success, but also set `LastError` to `ERROR_OPERATION_ABORTED`.

This change detects this case, and re-tries the call to `ReadConsoleW`.

Fixes #89177. See issue for further details.

Tested on Windows 7 and Windows 10 with both MSVC and GNU toolchains