diff options
author | Christian Mauderer <Christian.Mauderer@embedded-brains.de> | 2017-12-06 15:56:50 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-12-07 07:30:16 +0100 |
commit | 2fe368787e1f11e50813b10f4c027bbbb87c9999 (patch) | |
tree | 701973dff53456818041a83bfb8e07c53441f68c /testsuites/fstests/fsdosfsname01/init.c | |
parent | Remove obsolete network header files (diff) | |
download | rtems-2fe368787e1f11e50813b10f4c027bbbb87c9999.tar.bz2 |
dosfs: Allow creating a file with similar name.
If there is already a file with a long file name it isn't possible to
create a second file which has a name that ends on the first files name
(for example ets.beam and sets.beam). This patch fixes that.
Update #3258.
Diffstat (limited to 'testsuites/fstests/fsdosfsname01/init.c')
-rw-r--r-- | testsuites/fstests/fsdosfsname01/init.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/testsuites/fstests/fsdosfsname01/init.c b/testsuites/fstests/fsdosfsname01/init.c index eb66323073..ce6850cfa7 100644 --- a/testsuites/fstests/fsdosfsname01/init.c +++ b/testsuites/fstests/fsdosfsname01/init.c @@ -1097,6 +1097,30 @@ static void test_end_of_string_matches( void ) rtems_test_assert( rc == 0 ); } +static void test_end_of_string_matches_2( void ) +{ + int rc; + int fd; + + fd = open( MOUNT_DIR "/ets.beam", O_RDWR | O_CREAT, + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH ); + rtems_test_assert( fd >= 0 ); + rc = close( fd ); + rtems_test_assert( rc == 0 ); + + fd = open( MOUNT_DIR "/sets.beam", O_RDWR | O_CREAT, + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH ); + rtems_test_assert( fd >= 0 ); + rc = close( fd ); + rtems_test_assert( rc == 0 ); + + rc = unlink( MOUNT_DIR "/sets.beam" ); + rtems_test_assert( rc == 0 ); + + rc = unlink( MOUNT_DIR "/ets.beam" ); + rtems_test_assert( rc == 0 ); +} + static void test_full_8_3_name( void ) { int rc; @@ -1151,6 +1175,7 @@ static void test_file_with_same_name_as_volume_label( void ) static void test_special_cases( void ) { test_end_of_string_matches(); + test_end_of_string_matches_2(); test_full_8_3_name(); test_file_with_same_name_as_volume_label(); test_dir_with_same_name_as_volume_label(); |