[rtems commit] Moved empty test in front of busy tests

Sebastian Huber sebh at rtems.org
Fri Feb 10 09:46:09 UTC 2012


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Feb  9 12:00:15 2012 +0100

Moved empty test in front of busy tests

---

 cpukit/libfs/src/dosfs/msdos_dir.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/cpukit/libfs/src/dosfs/msdos_dir.c b/cpukit/libfs/src/dosfs/msdos_dir.c
index a0ef507..494b9fb 100644
--- a/cpukit/libfs/src/dosfs/msdos_dir.c
+++ b/cpukit/libfs/src/dosfs/msdos_dir.c
@@ -641,16 +641,6 @@ msdos_dir_rmnod(rtems_filesystem_location_info_t *parent_pathloc,
         rtems_set_errno_and_return_minus_one(EIO);
 
     /*
-     * We deny attempts to delete open directory (if directory is current
-     * directory we assume it is open one)
-     */
-    if (fat_fd->links_num > 1)
-    {
-        rtems_semaphore_release(fs_info->vol_sema);
-        rtems_set_errno_and_return_minus_one(EBUSY);
-    }
-
-    /*
      * You cannot remove a node that still has children
      */
     rc = msdos_dir_is_empty(pathloc->mt_entry, fat_fd, &is_empty);
@@ -667,6 +657,16 @@ msdos_dir_rmnod(rtems_filesystem_location_info_t *parent_pathloc,
     }
 
     /*
+     * We deny attempts to delete open directory (if directory is current
+     * directory we assume it is open one)
+     */
+    if (fat_fd->links_num > 1)
+    {
+        rtems_semaphore_release(fs_info->vol_sema);
+        rtems_set_errno_and_return_minus_one(EBUSY);
+    }
+
+    /*
      * You cannot remove the file system root node.
      */
     if (rtems_filesystem_is_root_location(pathloc))




More information about the vc mailing list