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
This commit is contained in:
parent
3308c46e47
commit
0148e1ee90
6 changed files with 20 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue