From: Charles Manning Date: Thu, 24 Jun 2010 21:45:43 +0000 (+1200) Subject: yaffs direct: Fix yaffs direct offset handling for pwrite X-Git-Tag: pre-name-change~50^2 X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=35251e467a7817c6b991d88797891b4b1c191d5f yaffs direct: Fix yaffs direct offset handling for pwrite Note that if the handle is opened with O_APPEND then the pwrite() offset is ignored and the write appends. Signed-off-by: Charles Manning --- diff --git a/direct/yaffsfs.c b/direct/yaffsfs.c index 9f6008d..2b64bc6 100644 --- a/direct/yaffsfs.c +++ b/direct/yaffsfs.c @@ -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;