aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/io
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2003-03-09 22:50:02 +0000
committerTom Tromey <tromey@gcc.gnu.org>2003-03-09 22:50:02 +0000
commit5e18b3d6a653eeb64d92597536feac32ea1be0b9 (patch)
tree49af5800f39c40dab0fae23d38ed2de67103832a /libjava/java/io
parent95dca20c9c6f8f810efe1ab58c8c0f425415e715 (diff)
downloadgcc-5e18b3d6a653eeb64d92597536feac32ea1be0b9.zip
gcc-5e18b3d6a653eeb64d92597536feac32ea1be0b9.tar.gz
gcc-5e18b3d6a653eeb64d92597536feac32ea1be0b9.tar.bz2
re PR libgcj/9934 (Bugs in natFileDescriptorPosix.cc:available())
PR libgcj/9934: * java/io/natFileDescriptorPosix.cc (available): Fixed arguments to lseek. Return 0 if we can't compute the value. From-SVN: r64053
Diffstat (limited to 'libjava/java/io')
-rw-r--r--libjava/java/io/natFileDescriptorPosix.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/libjava/java/io/natFileDescriptorPosix.cc b/libjava/java/io/natFileDescriptorPosix.cc
index e8ec9a7..ad1dcc4 100644
--- a/libjava/java/io/natFileDescriptorPosix.cc
+++ b/libjava/java/io/natFileDescriptorPosix.cc
@@ -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
}