Merge branch 'master' of ssh://www.aleph1.co.uk/home/aleph1/git/yaffs2
[yaffs2.git] / direct / yaffsfs.c
index c09513277c270eb2b70c46bb38c23fd6f51cc6c2..041287c1e77405a01ee575bb13a4906928fcf0a2 100644 (file)
@@ -826,10 +826,10 @@ int yaffsfs_do_write(int fd, const void *vbuf, unsigned int nbyte, int isPwrite,
                yaffsfs_SetError(-EINVAL);
                totalWritten=-1;
        } else if( h && obj){
-               if(isPwrite)
-                       startPos = offset;
                if(h->append)
                        startPos = yaffs_GetObjectFileLength(obj);
+               else if(isPwrite)
+                       startPos = offset;
                else
                        startPos = h->position;