#1679 closed defect (duplicate)

semantic error on "cpukit/libfs/src/imfs/imfs_create.c"

Reported by: Chester Owned by: Chris Johns
Priority: normal Milestone: 4.11
Component: fs Version: 4.10
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

(rtems-cvs-20100814)
line 67:

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 ) { bug!!!

node->info.file.size = 0;
node->info.file.indirect = 0;
node->info.file.doubly_indirect = 0;
node->info.file.triply_indirect = 0;

}

} else if ( type == IMFS_FIFO ) {

node->info.fifo.pipe = NULL;

} else {

IMFS_assert(0);

}

It should be:

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;

} else 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;

} else if ( type == IMFS_FIFO ) {

node->info.fifo.pipe = NULL;

} else {

IMFS_assert(0);

}

Change History (1)

comment:1 Changed on Aug 18, 2010 at 8:44:28 AM by Chris Johns

Resolution: duplicate
Status: newclosed

Thanks for providing the fix. I will fix on 1679.

Note: See TracTickets for help on using tickets.