Files
MSYS2-packages/gcc/0004-Cygwin-ioctl-may-emit-EINVAL.patch
2016-03-28 12:49:54 +03:00

28 lines
1018 B
Diff

From f590da14fcd201f8f2a1538523a6cfc279861842 Mon Sep 17 00:00:00 2001
From: Jonathan Yong <10walls@gmail.com>
Date: Sat, 28 Jun 2014 08:37:16 +0800
Subject: [PATCH 04/21] Cygwin ioctl may emit EINVAL
On Cygwin (on X86) ioctl on FIONREAD returns EINVAL on the errno variable instead of ENOTTY
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35536
---
libjava/gnu/java/nio/channels/natFileChannelPosix.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libjava/gnu/java/nio/channels/natFileChannelPosix.cc b/libjava/gnu/java/nio/channels/natFileChannelPosix.cc
index e05904c..0a2569c 100644
--- a/libjava/gnu/java/nio/channels/natFileChannelPosix.cc
+++ b/libjava/gnu/java/nio/channels/natFileChannelPosix.cc
@@ -386,7 +386,7 @@ FileChannelImpl::available (void)
#if defined (FIONREAD)
r = ::ioctl (fd, FIONREAD, &num);
- if (r == -1 && errno == ENOTTY)
+ if (r == -1 && (errno == ENOTTY || errno == EINVAL))
{
// If the ioctl doesn't work, we don't care.
r = 0;
--
2.4.5