Changeset ebea7acf in mainline for uspace/app/mkexfat/mkexfat.c


Ignore:
Timestamp:
2012-02-29T18:29:37Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8efc4c1
Parents:
0f22528
Message:

mkexfat: Fill the content of the unused part of the root directory cluster with zeroes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/mkexfat/mkexfat.c

    r0f22528 rebea7acf  
    599599        int rc;
    600600        uint8_t *data;
     601        unsigned long i;
    601602
    602603        data = calloc(cfg->sector_size, 1);
     
    635636
    636637        rc = block_write_direct(service_id, rootdir_sec, 1, data);
    637 
     638        if (rc != EOK)
     639                goto exit;
     640
     641        /* Fill the content of the sectors not used by the
     642         * root directory with zeroes.
     643         */
     644        memset(data, 0, cfg->sector_size);
     645        for (i = 1; i < cfg->cluster_size / cfg->sector_size; ++i) {
     646                rc = block_write_direct(service_id, rootdir_sec + i, 1, data);
     647                if (rc != EOK)
     648                        goto exit;
     649        }
     650
     651exit:
    638652        free(data);
    639653        return rc;
Note: See TracChangeset for help on using the changeset viewer.