Patch: FYI: fix PR 9934

Tom Tromey tromey@redhat.com
Sun Mar 9 22:49:00 GMT 2003


I'm checking this in to the trunk and the branch.

This fixes PR libgcj/9934.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	PR libgcj/9934:
	* java/io/natFileDescriptorPosix.cc (available): Fixed arguments
	to lseek.  Return 0 if we can't compute the value.

Index: java/io/natFileDescriptorPosix.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/natFileDescriptorPosix.cc,v
retrieving revision 1.24
diff -u -r1.24 natFileDescriptorPosix.cc
--- java/io/natFileDescriptorPosix.cc 4 Jan 2003 03:53:00 -0000 1.24
+++ java/io/natFileDescriptorPosix.cc 9 Mar 2003 22:47:59 -0000
@@ -371,7 +371,7 @@
       off_t where = 0;
       if (fstat (fd, &sb) != -1
 	  && S_ISREG (sb.st_mode)
-	  && (where = lseek (fd, SEEK_CUR, 0)) != (off_t) -1)
+	  && (where = lseek (fd, 0, SEEK_CUR)) != (off_t) -1)
 	{
 	  num = (long) (sb.st_size - where);
 	  num_set = true;
@@ -397,6 +397,6 @@
 
   return (jint) num;
 #else
-  throw new IOException (JvNewStringLatin1 ("unimplemented"));
+  return 0;
 #endif
 }



More information about the Java-patches mailing list