mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Treat closed Windows pipes as EOF when reading
This commit is contained in:
parent
73d7394519
commit
7361c104a5
1 changed files with 7 additions and 1 deletions
|
|
@ -2200,7 +2200,13 @@ ssize_t windows_read(int fd, void* buffer, size_t size)
|
|||
}
|
||||
|
||||
if (!ReadFile(h, buffer, size, &count, 0)) {
|
||||
windows_errno(GetLastError());
|
||||
DWORD error = GetLastError();
|
||||
|
||||
/* A closed Windows pipe has the same read semantics as a POSIX pipe at EOF. */
|
||||
if (error == ERROR_BROKEN_PIPE)
|
||||
return 0;
|
||||
|
||||
windows_errno(error);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue