author | Alberto Bertogli
<albertito@gmail.com> 2004-05-20 14:43:00 UTC |
committer | Alberto Bertogli
<albertito@gmail.com> 2007-07-15 12:49:16 UTC |
parent | 05b0e3965c8a6253717a1f18dcc2aba6509b215d |
libjio.c | +7 | -0 |
diff --git a/libjio.c b/libjio.c index cd51dae..bcef8e6 100644 --- a/libjio.c +++ b/libjio.c @@ -441,6 +441,13 @@ int jopen(struct jfs *fs, const char *name, int flags, int mode, int jflags) 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)