Patchwork Minor Cygwin patches

login
register
mail settings
Submitter JonY
Date July 15, 2013, 1:15 a.m.
Message ID <51E34D46.4000408@gmail.com>
Download mbox | patch
Permalink /patch/258920/
State New
Headers show

Comments

JonY - July 15, 2013, 1:15 a.m.
On 7/15/2013 06:02, Kai Tietz wrote:
> 2013/7/13 JonY <10walls@gmail.com>:
>> On 7/10/2013 20:43, JonY wrote:
>>> Hi,
>>>
>>> Attached are some minor patches, comments?
>>>
>>
>> Kai, ping?
> 
> 
> Please sent each patch as separate mail, and please add ChangeLogs for
> them too.  Additionally it would be fine to read some lines about
> cause for those patches.
> 

Changelog


2013-03-08  Yaakov Selkowitz <yselkowitz@users.sourceforge.net>

    PR 35536
    * (libjava/gnu/java/nio/channels/natFileChannelPosix.cc): FIONREAD
returns EINVAL on the errno variable instead of ENOTTY on Cygwin.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35536

Patch

--- origsrc/gcc-4.5.1/libjava/gnu/java/nio/channels/natFileChannelPosix.cc	2007-04-02 20:05:50.000000000 -0500
+++ src/gcc-4.5.1/libjava/gnu/java/nio/channels/natFileChannelPosix.cc	2010-10-27 13:39:34.044718100 -0500
@@ -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;