Fixes issue where running interactive measurement utilities (chartread, spotread, dispcal, etc.) as child processes on Windows with piped standard input causes non-blocking stdin polling to deadlock inside ReadFile(), freezing USB endpoint polling for instrument switch triggers.
In con_char(int wait) under if (stdin_type == FILE_TYPE_PIPE), query available bytes using PeekNamedPipe() before calling ReadFile().
When !wait and no bytes are available in the pipe, return immediately with 0 without blocking.
doc/ChangesSummary.html:
Updated change log.
### Summary
Fixes issue where running interactive measurement utilities (`chartread`, `spotread`, `dispcal`, etc.) as child processes on Windows with piped standard input causes non-blocking stdin polling to deadlock inside `ReadFile()`, freezing USB endpoint polling for instrument switch triggers.
Fixes #24
### Changes
- **`spectro/conv.c`**:
- In `con_char(int wait)` under `if (stdin_type == FILE_TYPE_PIPE)`, query available bytes using `PeekNamedPipe()` before calling `ReadFile()`.
- When `!wait` and no bytes are available in the pipe, return immediately with `0` without blocking.
- **`doc/ChangesSummary.html`**:
- Updated change log.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Fixes issue where running interactive measurement utilities (
chartread,spotread,dispcal, etc.) as child processes on Windows with piped standard input causes non-blocking stdin polling to deadlock insideReadFile(), freezing USB endpoint polling for instrument switch triggers.Fixes #24
Changes
spectro/conv.c:con_char(int wait)underif (stdin_type == FILE_TYPE_PIPE), query available bytes usingPeekNamedPipe()before callingReadFile().!waitand no bytes are available in the pipe, return immediately with0without blocking.doc/ChangesSummary.html: