summaryrefslogtreecommitdiff
path: root/cpukit/libcsupport/src/rmdir.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libcsupport/src/rmdir.c')
-rw-r--r--cpukit/libcsupport/src/rmdir.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/cpukit/libcsupport/src/rmdir.c b/cpukit/libcsupport/src/rmdir.c
index 4e7baf5e39..f2bc16e516 100644
--- a/cpukit/libcsupport/src/rmdir.c
+++ b/cpukit/libcsupport/src/rmdir.c
@@ -38,7 +38,12 @@ int rmdir( const char *path )
rtems_filesystem_node_types_t type = (*ops->node_type_h)( currentloc );
if ( type == RTEMS_FILESYSTEM_DIRECTORY ) {
- rv = (*ops->rmnod_h)( &parentloc, currentloc );
+ if ( !rtems_filesystem_location_is_root( currentloc ) ) {
+ rv = (*ops->rmnod_h)( &parentloc, currentloc );
+ } else {
+ rtems_filesystem_eval_path_error( &ctx, EBUSY );
+ rv = -1;
+ }
} else {
rtems_filesystem_eval_path_error( &ctx, ENOTDIR );
rv = -1;