Permalink
Browse files

Fixed double offset update.

The write() function updates the offset.
  • Loading branch information...
1 parent 5848a7e commit e354b3ace1855bd1e815e21b87d0991e7a9de580 @sebhub sebhub committed Sep 21, 2011
Showing with 1 addition and 5 deletions.
  1. +1 −5 rtems/rtems_yaffs.c
View
@@ -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;
}

0 comments on commit e354b3a

Please sign in to comment.