From 35251e467a7817c6b991d88797891b4b1c191d5f Mon Sep 17 00:00:00 2001 From: Charles Manning Date: Fri, 25 Jun 2010 09:45:43 +1200 Subject: [PATCH] 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 --- direct/yaffsfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.30.2