From e00cca9b74acb6ec67cc9696cd0a005aa3d991c3 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 21 Feb 2012 15:52:55 +0100 Subject: IMFS: Do not check for unsupported types Allow creation of nodes with an unsupported type. Later the usage of such nodes will return an error status. --- cpukit/libfs/src/imfs/imfs_creat.c | 10 ---------- testsuites/sptests/spfifo01/init.c | 24 +++++++++++++++++++++++- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/cpukit/libfs/src/imfs/imfs_creat.c b/cpukit/libfs/src/imfs/imfs_creat.c index 37e3ac0578..4c030a210f 100644 --- a/cpukit/libfs/src/imfs/imfs_creat.c +++ b/cpukit/libfs/src/imfs/imfs_creat.c @@ -44,16 +44,6 @@ IMFS_jnode_t *IMFS_create_node( parent = parent_loc->node_access; fs_info = parent_loc->mt_entry->fs_info; - /* - * Reject creation of FIFOs if support is disabled. - */ - if ( type == IMFS_FIFO && - fs_info->fifo_handlers == &rtems_filesystem_handlers_default ) { - errno = ENOTSUP; - - return NULL; - } - /* * Allocate filesystem node and fill in basic information */ diff --git a/testsuites/sptests/spfifo01/init.c b/testsuites/sptests/spfifo01/init.c index dc5f9750b4..71d2369220 100644 --- a/testsuites/sptests/spfifo01/init.c +++ b/testsuites/sptests/spfifo01/init.c @@ -15,6 +15,9 @@ #include #include +#include +#include +#include #include "tmacros.h" @@ -23,6 +26,9 @@ static void test_main(void) { int status = -1; + int fd; + char buf [1]; + ssize_t n; puts("\n\n*** FIFO / PIPE OPEN TEST - 1 ***"); @@ -32,7 +38,21 @@ static void test_main(void) "Must result in failure since pipes are disabled in the configuration." ); status = mkfifo(FIFO_PATH, 0777); - rtems_test_assert(status == -1); + rtems_test_assert(status == 0); + + fd = open(FIFO_PATH, O_RDWR); + rtems_test_assert(fd >= 0); + + n = read(fd, buf, sizeof(buf)); + rtems_test_assert(n == -1); + rtems_test_assert(errno == ENOTSUP); + + n = write(fd, buf, sizeof(buf)); + rtems_test_assert(n == -1); + rtems_test_assert(errno == ENOTSUP); + + status = close(fd); + rtems_test_assert(status == 0); puts("*** END OF FIFO / PIPE OPEN TEST - 1 ***"); } @@ -48,6 +68,8 @@ rtems_task Init(rtems_task_argument not_used) #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM +#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4 + #define CONFIGURE_MAXIMUM_TASKS 1 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -- cgit v1.2.3