java-patches@gcc.gnu.org
[Top] [All Lists]

Patch: FYI: fixlet in EINTR handling

Subject: Patch: FYI: fixlet in EINTR handling
From: Tom Tromey
Date: 19 Apr 2006 10:47:22 -0600
I'm checking this in on the trunk and the 4.1 branch.

While look at the EINTR code for Roman, I happened to notice a bug in
how we handle interrupted write()s.  Currently we add 'r' to 'written'
(et al) -- but in the EINTR case r==-1, which is wrong.  In this case
we just want to skip the update.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@xxxxxxxxxx>

        * gnu/java/nio/channels/natFileChannelPosix.cc (write): Properly
        handle EINTR.

Index: gnu/java/nio/channels/natFileChannelPosix.cc
===================================================================
--- gnu/java/nio/channels/natFileChannelPosix.cc        (revision 113013)
+++ gnu/java/nio/channels/natFileChannelPosix.cc        (working copy)
@@ -1,7 +1,7 @@
 
 // natFileChannelImplPosix.cc - Native part of FileChannelImpl class.
 
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004  Free Software 
Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006  Free Software 
Foundation
 
    This file is part of libgcj.
 
@@ -231,6 +231,7 @@
            }
          if (errno != EINTR)
            throw new IOException (JvNewStringLatin1 (strerror (errno)));
+         continue;
        }
 
       written += r;

<Prev in Thread] Current Thread [Next in Thread>
  • Patch: FYI: fixlet in EINTR handling, Tom Tromey <=