Fixed unlink not freeing cluster chains

This commit is contained in:
Michael Chisholm 2008-09-11 08:54:23 +00:00
parent bfb4d60d1f
commit d72dcb0384

View File

@ -46,6 +46,9 @@
2007-10-25 - Chishm 2007-10-25 - Chishm
* Use CLUSTER_ERROR when an error occurs with the FAT, not CLUSTER_FREE * Use CLUSTER_ERROR when an error occurs with the FAT, not CLUSTER_FREE
* Added statvfs functionality * Added statvfs functionality
2008-09-11 - Chishm
* Fixed unlink not freeing cluster chains -- discovered by rodries
*/ */
#include <string.h> #include <string.h>
@ -169,7 +172,7 @@ int _FAT_unlink_r (struct _reent *r, const char *path) {
} }
} }
if (!_FAT_fat_isValidCluster(partition, cluster)) { if (_FAT_fat_isValidCluster(partition, cluster)) {
// Remove the cluster chain for this file // Remove the cluster chain for this file
if (!_FAT_fat_clearLinks (partition, cluster)) { if (!_FAT_fat_clearLinks (partition, cluster)) {
r->_errno = EIO; r->_errno = EIO;