summaryrefslogtreecommitdiffstats
path: root/libjava/java
diff options
context:
space:
mode:
authorbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2002-04-29 03:54:50 +0000
committerbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2002-04-29 03:54:50 +0000
commit8f46646e6f06f1141a3c763affc27b325d602510 (patch)
tree05ed2612fd21e6357ecd4d4e8041d21a93fe1f87 /libjava/java
parent93bfa70bcf217f01a9500c72858a959cad489f49 (diff)
downloadppe42-gcc-8f46646e6f06f1141a3c763affc27b325d602510.tar.gz
ppe42-gcc-8f46646e6f06f1141a3c763affc27b325d602510.zip
2002-04-29 Adam King <aking@dreammechanics.com>
* java/io/natFileDescriptorWin32.cc (open): Move file pointer to end of file in APPEND mode. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52869 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java')
-rw-r--r--libjava/java/io/natFileDescriptorWin32.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/libjava/java/io/natFileDescriptorWin32.cc b/libjava/java/io/natFileDescriptorWin32.cc
index 694272a67bd..bc9cbc85bc9 100644
--- a/libjava/java/io/natFileDescriptorWin32.cc
+++ b/libjava/java/io/natFileDescriptorWin32.cc
@@ -124,6 +124,13 @@ java::io::FileDescriptor::open (jstring path, jint jflags) {
throw new FileNotFoundException (JvNewStringLatin1 (msg));
}
+ // For APPEND mode, move the file pointer to the end of the file.
+ if (jflags & APPEND)
+ {
+ DWORD low = SetFilePointer (handle, 0, NULL, FILE_END);
+ if ((low == 0xffffffff) && (GetLastError () != NO_ERROR))
+ throw new FileNotFoundException (JvNewStringLatin1 (winerr ()));
+ }
return (jint)handle;
}
OpenPOWER on IntegriCloud