author | Alberto Bertogli
<albertito@gmail.com> 2004-04-02 02:18:33 UTC |
committer | Alberto Bertogli
<albertito@gmail.com> 2007-07-15 12:31:26 UTC |
parent | 2f0dd658c407410890ec271b62eec9c9cba5edef |
libjio.c | +10 | -0 |
diff --git a/libjio.c b/libjio.c index a6fa8db..876a255 100644 --- a/libjio.c +++ b/libjio.c @@ -554,6 +554,11 @@ ssize_t jwrite(struct jfs *fs, void *buf, size_t count) ts.len = count; rv = jtrans_commit(&ts); + + if (rv >= 0) { + /* if success, advance the file pointer */ + lseek(fs->fd, count, SEEK_CUR); + } pthread_mutex_unlock(&(fs->lock)); return rv; @@ -616,6 +621,11 @@ ssize_t jwritev(struct jfs *fs, struct iovec *vector, int count) ts.len = sum; rv = jtrans_commit(&ts); + + if (rv >= 0) { + /* if success, advance the file pointer */ + lseek(fs->fd, count, SEEK_CUR); + } pthread_mutex_unlock(&(fs->lock)); return rv;