diff options
author | Chris Johns <chrisj@rtems.org> | 2013-07-27 23:57:05 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2013-07-27 23:57:05 +1000 |
commit | 681f198539eb42616de5ba8919034f86863926c5 (patch) | |
tree | b58202d38e1048975e4cf65034f9f01c4572249d | |
parent | libtests/malloc04: Fixes for RTEMS_DEBUG 2nd try (diff) | |
download | rtems-681f198539eb42616de5ba8919034f86863926c5.tar.bz2 |
Return the amount of data written when an error occurs rather than
the error.
The change lets the mrfs_fsrdwr test pass.
-rw-r--r-- | cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c b/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c index 7f2968ccda..a811ee521e 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c +++ b/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c @@ -3,7 +3,7 @@ * * @brief RTEMS RFS File Handlers * @ingroup rtems_rfs - * + * * This file contains the set of handlers used to process operations on * RFS file nodes. */ @@ -55,7 +55,7 @@ rtems_rfs_rtems_file_open (rtems_libio_t* iop, if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_OPEN)) printf("rtems-rfs: file-open: path:%s ino:%" PRId32 " flags:%04i mode:%04" PRIu32 "\n", - pathname, ino, flags, mode); + pathname, ino, flags, (uint32_t) mode); rtems_rfs_rtems_lock (fs); @@ -233,7 +233,13 @@ rtems_rfs_rtems_file_write (rtems_libio_t* iop, rc = rtems_rfs_file_io_start (file, &size, false); if (rc) { - write = rtems_rfs_rtems_error ("file-write: write open", rc); + /* + * If we have run out of space and have written some data return that + * amount first as the inode will have accounted for it. This means + * there was no error and the return code from can be ignored. + */ + if (!write) + write = rtems_rfs_rtems_error ("file-write: write open", rc); break; } |