Changeset 0f22528 in mainline
- Timestamp:
- 2012-02-28T21:57:27Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ebea7acf
- Parents:
- 9bbe54f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/mkexfat/mkexfat.c
r9bbe54f r0f22528 144 144 { 145 145 unsigned long fat_bytes; 146 unsigned long fat_cls; 146 147 aoff64_t const volume_bytes = (cfg->volume_count - FAT_SECTOR_START) * 147 148 cfg->sector_size; … … 180 181 * number of available clusters. 181 182 */ 182 cfg->total_clusters -= div_round_up((cfg->data_start_sector -183 fat_cls = div_round_up((cfg->data_start_sector - 183 184 FAT_SECTOR_START) * cfg->sector_size, 184 185 cfg->cluster_size); 186 if (fat_cls >= cfg->total_clusters) { 187 /* Insufficient disk space on device */ 188 cfg->total_clusters = 0; 189 return; 190 } 191 cfg->total_clusters -= fat_cls; 185 192 186 193 /* Compute the bitmap size */ … … 821 828 cfg_print_info(&cfg); 822 829 823 if ( (cfg.total_clusters - cfg.allocated_clusters) <=2) {830 if (cfg.total_clusters <= cfg.allocated_clusters + 2) { 824 831 printf(NAME ": Error, insufficient disk space on device.\n"); 825 832 return 2; … … 897 904 } 898 905 906 printf(NAME ": Writing the boot sectors.\n"); 907 899 908 rc = bootsec_write(service_id, &cfg); 900 909 if (rc != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.