[rtems commit] dosfs: Check error status

Sebastian Huber sebh at rtems.org
Thu Sep 11 11:13:23 UTC 2014


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Sep 11 13:04:42 2014 +0200

dosfs: Check error status

---

 cpukit/libfs/src/dosfs/msdos_misc.c |   30 ++++++++++++++++--------------
 1 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/cpukit/libfs/src/dosfs/msdos_misc.c b/cpukit/libfs/src/dosfs/msdos_misc.c
index c09aa19..03ec38f 100644
--- a/cpukit/libfs/src/dosfs/msdos_misc.c
+++ b/cpukit/libfs/src/dosfs/msdos_misc.c
@@ -2001,20 +2001,22 @@ msdos_find_name_in_fat_file (
               retval = -1;
           break;
         }
-        retval = msdos_add_file (
-            buffer,
-            name_type,
-            fs_info,
-            fat_fd,
-            bts2rd,
-            fat_entries,
-            name_dir_entry,
-            dir_pos,
-            dir_offset,
-            empty_space_offset,
-            empty_space_entry,
-            empty_space_count
-        );
+
+        if (retval == RC_OK)
+            retval = msdos_add_file (
+                buffer,
+                name_type,
+                fs_info,
+                fat_fd,
+                bts2rd,
+                fat_entries,
+                name_dir_entry,
+                dir_pos,
+                dir_offset,
+                empty_space_offset,
+                empty_space_entry,
+                empty_space_count
+            );
     }
 
     return retval;



More information about the vc mailing list