mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-07-23 14:04:59 +02:00
Fix for ReadFileEx synchronously failing with EOF error on 2012
This commit is contained in:
parent
3ffe279bf7
commit
fa0fdc47a6
@ -357,7 +357,14 @@ fileio_read(struct w32_io* pio, void *dst, unsigned int max) {
|
|||||||
if ((FILETYPE(pio) == FILE_TYPE_PIPE)
|
if ((FILETYPE(pio) == FILE_TYPE_PIPE)
|
||||||
&& (errno == ERROR_NEGATIVE_SEEK)) {
|
&& (errno == ERROR_NEGATIVE_SEEK)) {
|
||||||
/* write end of the pipe closed */
|
/* write end of the pipe closed */
|
||||||
debug2("read - no more data, io:%p", pio);
|
debug("read - no more data, io:%p", pio);
|
||||||
|
errno = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
/* on W2012, ReadFileEx on file throws a synchronous EOF error*/
|
||||||
|
else if ((FILETYPE(pio) == FILE_TYPE_DISK)
|
||||||
|
&& (errno == ERROR_HANDLE_EOF)) {
|
||||||
|
debug("read - no more data, io:%p", pio);
|
||||||
errno = 0;
|
errno = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user