[rtems commit] dosfs/msdos_file.c: Return an error if it occurs

Joel Sherril joel at rtems.org
Wed Nov 26 13:55:51 UTC 2014


Module:    rtems
Branch:    master
Commit:    21c0ca84262e41b59e44b44945980ee0f8cb0a1a
Changeset: http://git.rtems.org/rtems/commit/?id=21c0ca84262e41b59e44b44945980ee0f8cb0a1a

Author:    Josh Oguin <josh.oguin at oarcorp.com>
Date:      Wed Nov 19 14:38:16 2014 -0600

dosfs/msdos_file.c: Return an error if it occurs

CodeSonar flagged this as a case where the return value from fat_sync()
was not used. Now it is used to return pass/fail to the caller.

---

 cpukit/libfs/src/dosfs/msdos_file.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/cpukit/libfs/src/dosfs/msdos_file.c b/cpukit/libfs/src/dosfs/msdos_file.c
index 7a09272..1d62886 100644
--- a/cpukit/libfs/src/dosfs/msdos_file.c
+++ b/cpukit/libfs/src/dosfs/msdos_file.c
@@ -244,5 +244,8 @@ msdos_file_sync(rtems_libio_t *iop)
     rc = fat_sync(&fs_info->fat);
 
     rtems_semaphore_release(fs_info->vol_sema);
-    return RC_OK;
+    if ( rc == 0 )
+      return RC_OK;
+
+    rtems_set_errno_and_return_minus_one(EIO);
 }




More information about the vc mailing list