Union FS. Correct some handling when the last file is closed

This commit is contained in:
Gregory Nutt 2015-06-06 10:00:26 -06:00
parent 597493221e
commit 884f3cdf74

View File

@ -791,7 +791,7 @@ static int unionfs_close(FAR struct file *filep)
* unlinked, then destroy the file system now.
*/
if (--ui->ui_nopen <= 0)
if (--ui->ui_nopen <= 0 && ui->ui_unhooked)
{
unionfs_destroy(ui);
}