re PR libgcj/9934 (Bugs in natFileDescriptorPosix.cc:available())
authorTom Tromey <tromey@redhat.com>
Sun, 9 Mar 2003 22:50:02 +0000 (22:50 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Sun, 9 Mar 2003 22:50:02 +0000 (22:50 +0000)
PR libgcj/9934:
* java/io/natFileDescriptorPosix.cc (available): Fixed arguments
to lseek.  Return 0 if we can't compute the value.

From-SVN: r64053

libjava/ChangeLog
libjava/java/io/natFileDescriptorPosix.cc

index 5dd727379b281c9ec7ca8a2f91ed1768cfb7cf9a..8689e79a3d486a8bb3ad8f598244ebb42a284efa 100644 (file)
@@ -1,3 +1,9 @@
+2003-03-09  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.
+
 2003-03-03  Michael Koch  <konqueror@gmx.de>
 
        * java/net/NetworkInterface.java: Merged with classpath.
index e8ec9a7e733b9d8f856fec2246c3046f0013830f..ad1dcc49c32d2a85aa412ab7c722b350f1353ebd 100644 (file)
@@ -371,7 +371,7 @@ java::io::FileDescriptor::available (void)
       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 @@ java::io::FileDescriptor::available (void)
 
   return (jint) num;
 #else
-  throw new IOException (JvNewStringLatin1 ("unimplemented"));
+  return 0;
 #endif
 }