diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-02-10 17:04:54 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-02-10 17:04:54 +0000 |
commit | efb1b830bbcb4bae5df881c82bab5d2dec4b119d (patch) | |
tree | ef1d3008091eeeb6722b9a39773fad7bd2c09788 /c/src/lib | |
parent | Added getcwd(). (diff) | |
download | rtems-efb1b830bbcb4bae5df881c82bab5d2dec4b119d.tar.bz2 |
Corrected multiple places the file size was not being properly updated.
Diffstat (limited to 'c/src/lib')
-rw-r--r-- | c/src/lib/libc/memfile.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/c/src/lib/libc/memfile.c b/c/src/lib/libc/memfile.c index 01aee443f3..eda9d6b4a1 100644 --- a/c/src/lib/libc/memfile.c +++ b/c/src/lib/libc/memfile.c @@ -145,10 +145,14 @@ int memfile_write( ) { IMFS_jnode_t *the_jnode; + int status; the_jnode = iop->file_info; - return IMFS_memfile_write( the_jnode, iop->offset, buffer, count ); + status = IMFS_memfile_write( the_jnode, iop->offset, buffer, count ); + iop->size = the_jnode->info.file.size; + + return status; } /* @@ -191,7 +195,8 @@ int memfile_lseek( if (IMFS_memfile_extend( the_jnode, iop->offset )) set_errno_and_return_minus_one( ENOSPC ); - return 0; + iop->size = the_jnode->info.file.size; + return iop->offset; } /* @@ -231,6 +236,7 @@ int memfile_ftruncate( */ the_jnode->info.file.size = length; + iop->size = the_jnode->info.file.size; IMFS_update_atime( the_jnode ); |