summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs/src/rfs/rtems-rfs-file.c
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2011-03-15 05:02:34 +0000
committerChris Johns <chrisj@rtems.org>2011-03-15 05:02:34 +0000
commitd0fcd0b8a660e12e2f99affe198f035cf2cf8256 (patch)
treef6bc0d4e897c276a21e6ebcd40766e5040c6377a /cpukit/libfs/src/rfs/rtems-rfs-file.c
parent2011-03-14 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-d0fcd0b8a660e12e2f99affe198f035cf2cf8256.tar.bz2
2011-03-15 Chris Johns <chrisj@rtems.org>
PR 1763/shell * libmisc/shell/hexdump-conv.c: Remove debug hacks. PR 1757/filesystem * libfs/src/rfs/rtems-rfs-block-pos.h, libfs/src/rfs/rtems-rfs-block.h, libfs/src/rfs/rtems-rfs-file.c, libfs/src/rfs/rtems-rfs-rtems-file.c: Set the file size in iop-size when a file is open. Fix lseek to end of file then write for sizes less than half the file system block size. * libfs/src/rfs/rtems-rfs-rtems-dev.c, libfs/src/rfs/rtems-rfs-rtems-dir.c, libfs/src/rfs/rtems-rfs-rtems.c, libfs/src/rfs/rtems-rfs-rtems.h: Fix the fstat and fchmod calls due to the change in the iop struct where pathinfo went away. The node_access field in pathinfo was overloaded.
Diffstat (limited to 'cpukit/libfs/src/rfs/rtems-rfs-file.c')
-rw-r--r--cpukit/libfs/src/rfs/rtems-rfs-file.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/cpukit/libfs/src/rfs/rtems-rfs-file.c b/cpukit/libfs/src/rfs/rtems-rfs-file.c
index e17c705c8c..777726a23a 100644
--- a/cpukit/libfs/src/rfs/rtems-rfs-file.c
+++ b/cpukit/libfs/src/rfs/rtems-rfs-file.c
@@ -172,8 +172,10 @@ rtems_rfs_file_close (rtems_rfs_file_system* fs,
handle->shared->mtime);
rtems_rfs_inode_set_ctime (&handle->shared->inode,
handle->shared->ctime);
- handle->shared->map.size.count = handle->shared->size.count;
- handle->shared->map.size.offset = handle->shared->size.offset;
+ if (!rtems_rfs_block_size_equal (&handle->shared->size,
+ &handle->shared->map.size))
+ rtems_rfs_block_map_set_size (&handle->shared->map,
+ &handle->shared->size);
}
rc = rtems_rfs_block_map_close (fs, &handle->shared->map);
@@ -420,8 +422,8 @@ rtems_rfs_file_seek (rtems_rfs_file_handle* handle,
* This means the file needs to set the file size to the pos only when a
* write occurs.
*/
- if (pos <= rtems_rfs_file_shared_get_size (rtems_rfs_file_fs (handle),
- handle->shared))
+ if (pos < rtems_rfs_file_shared_get_size (rtems_rfs_file_fs (handle),
+ handle->shared))
rtems_rfs_file_set_bpos (handle, pos);
*new_pos = pos;