[Yaffs] [PATCH 16/20] Fixed double offset update.

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Xiangfu Liu
Date:  
To: yaffs
CC: sebastien
Old-Topics: [Yaffs] [PATCH 15/20] rename rtems-mkyaffs2image to nor-mkyaffs2image
New-Topics: [Yaffs] [PATCH 17/20] Fixed return value of ycb_file_lseek().
Subject: [Yaffs] [PATCH 16/20] Fixed double offset update.
From: Sebastian Huber <>

The write() function updates the offset.
---
 rtems/rtems_yaffs.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)


diff --git a/rtems/rtems_yaffs.c b/rtems/rtems_yaffs.c
index 6867bee..b95902a 100644
--- a/rtems/rtems_yaffs.c
+++ b/rtems/rtems_yaffs.c
@@ -764,11 +764,7 @@ static ssize_t ycb_file_write(rtems_libio_t *iop, const void *buffer, size_t cou
     if (is_valid_offset(new_offset)) {
         rv = yaffs_wr_file(obj, buffer, offset, (int) count, 0);
         if (rv > 0) {
-            new_offset = offset + rv;
-            iop->offset = new_offset;
-            if (iop->size < new_offset) {
-                iop->size = new_offset;
-            }
+            iop->size = yaffs_get_obj_length(obj);
         } else {
             errno = ENOSPC;
         }
-- 
1.7.4.1