mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 23:23:13 +00:00
2003-06-10 Phil Torre <ptorre@zetron.com>
PR 411/filesystem * src/imfs/imfs_unlink.c: Fix bug where renaming a memfile and then unlinking it causes a memory leak.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2003-06-10 Phil Torre <ptorre@zetron.com>
|
||||||
|
|
||||||
|
PR 411/filesystem
|
||||||
|
* src/imfs/imfs_unlink.c: Fix bug where renaming a memfile and
|
||||||
|
then unlinking it causes a memory leak.
|
||||||
|
|
||||||
2003-03-25 Thomas Doerfler <Thomas.Doerfler@imd-systems.de>
|
2003-03-25 Thomas Doerfler <Thomas.Doerfler@imd-systems.de>
|
||||||
|
|
||||||
PR 367/filesystem
|
PR 367/filesystem
|
||||||
|
|||||||
@@ -58,13 +58,17 @@ int IMFS_unlink(
|
|||||||
* to remove the node that is a link and the node itself.
|
* to remove the node that is a link and the node itself.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
node->info.hard_link.link_node->st_nlink --;
|
if ( node->info.hard_link.link_node->st_nlink == 1)
|
||||||
IMFS_update_ctime( node->info.hard_link.link_node );
|
{
|
||||||
if ( node->info.hard_link.link_node->st_nlink < 1) {
|
|
||||||
result = (*the_link.handlers->rmnod_h)( &the_link );
|
result = (*the_link.handlers->rmnod_h)( &the_link );
|
||||||
if ( result != 0 )
|
if ( result != 0 )
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
node->info.hard_link.link_node->st_nlink --;
|
||||||
|
IMFS_update_ctime( node->info.hard_link.link_node );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user