mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-15 22:01:36 -08:00
Solve some typos with file handles in Windows.
This commit is contained in:
parent
045b6d6ab1
commit
6da470c25e
1 changed files with 7 additions and 6 deletions
13
src/c/file.d
13
src/c/file.d
|
|
@ -2614,7 +2614,7 @@ io_file_clear_input(cl_object strm)
|
|||
#if defined(mingw32) || defined(_MSC_VER)
|
||||
if (isatty(f)) {
|
||||
/* Flushes Win32 console */
|
||||
if (!FlushConsoleInputBuffer((HANDLE)_get_osfhandle(fileno(fp))))
|
||||
if (!FlushConsoleInputBuffer((HANDLE)_get_osfhandle(f)))
|
||||
FEwin32_error("FlushConsoleInputBuffer() failed", 0);
|
||||
/* Do not stop here: the FILE structure needs also to be flushed */
|
||||
}
|
||||
|
|
@ -3235,18 +3235,19 @@ io_stream_listen(cl_object strm)
|
|||
static void
|
||||
io_stream_clear_input(cl_object strm)
|
||||
{
|
||||
FILE *f = IO_STREAM_FILE(strm);
|
||||
FILE *fp = IO_STREAM_FILE(strm);
|
||||
#if defined(mingw32) || defined(_MSC_VER)
|
||||
if (isatty(fileno(fp))) {
|
||||
int f = fileno(fp);
|
||||
if (isatty(f)) {
|
||||
/* Flushes Win32 console */
|
||||
if (!FlushConsoleInputBuffer((HANDLE)_get_osfhandle(fileno(fp))))
|
||||
if (!FlushConsoleInputBuffer((HANDLE)_get_osfhandle(f)))
|
||||
FEwin32_error("FlushConsoleInputBuffer() failed", 0);
|
||||
/* Do not stop here: the FILE structure needs also to be flushed */
|
||||
}
|
||||
#endif
|
||||
while (flisten(f) == ECL_LISTEN_AVAILABLE) {
|
||||
while (flisten(fp) == ECL_LISTEN_AVAILABLE) {
|
||||
ecl_disable_interrupts();
|
||||
getc(f);
|
||||
getc(fp);
|
||||
ecl_enable_interrupts();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue