aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/io
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2002-08-29 18:05:15 +0000
committerTom Tromey <tromey@gcc.gnu.org>2002-08-29 18:05:15 +0000
commit0148e1ee90a9cec90cbd0b32b99cf532eaae9699 (patch)
treea31a718cf9037c5c8f783d5e793792805d6ed4b0 /libjava/java/io
parent3308c46e47a0b17d37b4c29a130e6519c424a737 (diff)
downloadgcc-0148e1ee90a9cec90cbd0b32b99cf532eaae9699.zip
gcc-0148e1ee90a9cec90cbd0b32b99cf532eaae9699.tar.gz
gcc-0148e1ee90a9cec90cbd0b32b99cf532eaae9699.tar.bz2
natFileDescriptorPosix.cc (setLength): Handle case where ftruncate is missing.
* java/io/natFileDescriptorPosix.cc (setLength): Handle case where ftruncate is missing. * configure, include/config.h.in: Rebuilt. * acconfig.h (HAVE_FTRUNCATE): Mention. * configure.in: Check for ftruncate. From-SVN: r56658
Diffstat (limited to 'libjava/java/io')
-rw-r--r--libjava/java/io/natFileDescriptorPosix.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/libjava/java/io/natFileDescriptorPosix.cc b/libjava/java/io/natFileDescriptorPosix.cc
index 9f4c7c3..9929c30 100644
--- a/libjava/java/io/natFileDescriptorPosix.cc
+++ b/libjava/java/io/natFileDescriptorPosix.cc
@@ -195,6 +195,7 @@ java::io::FileDescriptor::setLength (jlong pos)
struct stat sb;
off_t orig;
+#ifdef HAVE_FTRUNCATE
if (::fstat (fd, &sb))
throw new IOException (JvNewStringLatin1 (strerror (errno)));
@@ -219,6 +220,9 @@ java::io::FileDescriptor::setLength (jlong pos)
}
else if (::ftruncate (fd, (off_t) pos))
throw new IOException (JvNewStringLatin1 (strerror (errno)));
+#else /* HAVE_FTRUNCATE */
+ throw new IOException (JvNewStringLatin1 ("FileDescriptor.setLength not implemented"));
+#endif /* HAVE_FTRUNCATE */
}
jint