

We always need to read from files, even if jopen() is called with O_WRONLY,
because we read the contents and save them to the transaction file before
commiting it.



---

 cur-root/libjio.c |    7 +++++++
 1 files changed, 7 insertions(+)

diff -puN libjio.c~always_open_read libjio.c
--- cur/libjio.c~always_open_read	2004-05-20 11:26:21.236390968 -0300
+++ cur-root/libjio.c	2004-05-20 11:42:56.569077400 -0300
@@ -441,6 +441,13 @@ int jopen(struct jfs *fs, const char *na
 	unsigned int t;
 	char jdir[PATH_MAX], jlockfile[PATH_MAX];
 	struct stat sinfo;
+
+	/* we always need read access, because when we commit a transaction we
+	 * read the current contents before applying */
+	if (flags & O_WRONLY) {
+		flags = flags & ~O_WRONLY;
+		flags = flags | O_RDWR;
+	}
 	
 	fd = open(name, flags, mode);
 	if (fd < 0)

_
