diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-08-02 18:27:23 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-08-02 18:27:23 +0000 |
commit | 8851c0a5ef60f8ed98ceda73f9430e023e823a57 (patch) | |
tree | d8f23141fcd65d8072be7febdd12ab9bd9cd4cfc /cpukit/libfs/src/imfs/imfs_creat.c | |
parent | 5114d3ffd2f5c43c3f82abdbace99d1f5c34c5cd (diff) |
2010-08-02 Joel Sherrill <joel.sherrill@oarcorp.com>
* libfs/src/imfs/imfs_creat.c, libfs/src/imfs/imfs_eval.c,
libfs/src/imfs/imfs_mknod.c, libfs/src/imfs/imfs_readlink.c,
libfs/src/pipe/fifo.c: Clean up for coverage improvements and
formatting.
Diffstat (limited to 'cpukit/libfs/src/imfs/imfs_creat.c')
-rw-r--r-- | cpukit/libfs/src/imfs/imfs_creat.c | 50 |
1 files changed, 18 insertions, 32 deletions
diff --git a/cpukit/libfs/src/imfs/imfs_creat.c b/cpukit/libfs/src/imfs/imfs_creat.c index a33f3c580b..e8e3ef10a0 100644 --- a/cpukit/libfs/src/imfs/imfs_creat.c +++ b/cpukit/libfs/src/imfs/imfs_creat.c @@ -64,42 +64,28 @@ IMFS_jnode_t *IMFS_create_node( /* * Set the type specific information */ - switch (type) { - case IMFS_DIRECTORY: - rtems_chain_initialize_empty(&node->info.directory.Entries); - break; - - case IMFS_HARD_LINK: - node->info.hard_link.link_node = info->hard_link.link_node; - break; - - case IMFS_SYM_LINK: - node->info.sym_link.name = info->sym_link.name; - break; - - case IMFS_DEVICE: - node->info.device.major = info->device.major; - node->info.device.minor = info->device.minor; - break; - - case IMFS_LINEAR_FILE: - node->info.linearfile.size = 0; - node->info.linearfile.direct = 0; - - case IMFS_MEMORY_FILE: + if ( type == IMFS_DIRECTORY ) { + rtems_chain_initialize_empty(&node->info.directory.Entries); + } else if ( type == IMFS_HARD_LINK ) { + node->info.hard_link.link_node = info->hard_link.link_node; + } else if ( type == IMFS_SYM_LINK ) { + node->info.sym_link.name = info->sym_link.name; + } else if ( type == IMFS_DEVICE ) { + node->info.device.major = info->device.major; + node->info.device.minor = info->device.minor; + } else if ( type == IMFS_LINEAR_FILE ) { + node->info.linearfile.size = 0; + node->info.linearfile.direct = 0; + if ( type == IMFS_MEMORY_FILE ) { node->info.file.size = 0; node->info.file.indirect = 0; node->info.file.doubly_indirect = 0; node->info.file.triply_indirect = 0; - break; - - case IMFS_FIFO: - node->info.fifo.pipe = NULL; - break; - - default: - IMFS_assert(0); - break; + } + } else if ( type == IMFS_FIFO ) { + node->info.fifo.pipe = NULL; + } else { + IMFS_assert(0); } /* |