X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fwin32_replacements.c;h=c9a59bab0a90e3fd4d03aff965821362e552a487;hp=36cc8a357e884a177c41b89eb9eee7c2493c7b02;hb=61db93f82eca3fe9f7676355c709c58cc425a6ad;hpb=c772c186e1e2b85aceed1f0d4ef115fb01d23425 diff --git a/src/win32_replacements.c b/src/win32_replacements.c index 36cc8a35..c9a59bab 100644 --- a/src/win32_replacements.c +++ b/src/win32_replacements.c @@ -177,12 +177,15 @@ do_pread_or_pwrite(int fd, void *buf, size_t count, off_t offset, OVERLAPPED overlapped; BOOL bret; - wimlib_assert(count <= 0xffffffff); - h = (HANDLE)_get_osfhandle(fd); if (h == INVALID_HANDLE_VALUE) goto err; + if (GetFileType(h) == FILE_TYPE_PIPE) { + errno = ESPIPE; + goto err; + } + /* Get original position */ relative_offset.QuadPart = 0; if (!SetFilePointerEx(h, relative_offset, &orig_offset, FILE_CURRENT))