From 0148e1ee90a9cec90cbd0b32b99cf532eaae9699 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 29 Aug 2002 18:05:15 +0000 Subject: 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 --- libjava/java/io/natFileDescriptorPosix.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libjava/java') 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 -- cgit v1.1