This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: fixlet in EINTR handling


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@redhat.com>

	* 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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]