From 681f198539eb42616de5ba8919034f86863926c5 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Sat, 27 Jul 2013 23:57:05 +1000 Subject: Return the amount of data written when an error occurs rather than the error. The change lets the mrfs_fsrdwr test pass. --- cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c | 12 +++++++++--- 1 file 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; } -- cgit v1.2.3