summaryrefslogtreecommitdiff
path: root/packages/midpath/files/fix-openfile.patch
diff options
context:
space:
mode:
authorRobert Schuster <thebohemian@gmx.net>2008-12-05 12:30:31 +0100
committerRobert Schuster <thebohemian@gmx.net>2008-12-05 12:30:31 +0100
commit5fd3e409aa0b309a279a3c10f068e88703fbe48c (patch)
treef7289d8ed076d8803220fd6b21f230ad3a77653e /packages/midpath/files/fix-openfile.patch
parentd7afe2429ffcbdc591ac26077030f9e29f5b4c87 (diff)
midpath-core 0.2+0.3rc2: Updated fix-openfile patch to what was committed upstream.
Diffstat (limited to 'packages/midpath/files/fix-openfile.patch')
-rw-r--r--packages/midpath/files/fix-openfile.patch21
1 files changed, 15 insertions, 6 deletions
diff --git a/packages/midpath/files/fix-openfile.patch b/packages/midpath/files/fix-openfile.patch
index 6b9b8be237..392364b3e3 100644
--- a/packages/midpath/files/fix-openfile.patch
+++ b/packages/midpath/files/fix-openfile.patch
@@ -1,13 +1,22 @@
Index: midpath-0.3rc2/components/core/src/org/thenesis/midpath/io/backend/j2se/FileHandlerImpl.java
===================================================================
--- midpath-0.3rc2.orig/components/core/src/org/thenesis/midpath/io/backend/j2se/FileHandlerImpl.java 2008-12-04 21:10:39.000000000 +0100
-+++ midpath-0.3rc2/components/core/src/org/thenesis/midpath/io/backend/j2se/FileHandlerImpl.java 2008-12-04 21:12:11.000000000 +0100
-@@ -182,7 +182,7 @@
++++ midpath-0.3rc2/components/core/src/org/thenesis/midpath/io/backend/j2se/FileHandlerImpl.java 2008-12-05 12:29:47.000000000 +0100
+@@ -181,10 +181,13 @@
+
public void openForRead() throws IOException {
if (randomAccessFile == null) {
- //stream = new FileRandomAccessStream(file);
+- //stream = new FileRandomAccessStream(file);
- randomAccessFile = new RandomAccessFile(file, "rws");
-+ randomAccessFile = new RandomAccessFile(file, "r");
- }
- }
+- }
+- }
++ // Try to get maximum rights to avoid closing the stream if openForWrite is called next
++ if (file.canWrite()) {
++ randomAccessFile = new RandomAccessFile(file, "rws");
++ } else {
++ randomAccessFile = new RandomAccessFile(file, "r");
++ }
++ }
+ public void openForWrite() throws IOException {
+ if (randomAccessFile == null) {