Changeset 875bc8b in mainline


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

mkexfat: force the user to specify the fs size if we failed to obtain the block device size.

File:
1 edited

Legend:

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

    rb4b3cb05 r875bc8b  
    803803        rc = block_get_bsize(service_id, &cfg.sector_size);
    804804        if (rc != EOK) {
    805                 printf(NAME ": Error determining device block size.\n");
     805                printf(NAME ": Error determining device sector size.\n");
    806806                return 2;
    807807        }
    808808
    809809        user_fs_size *= cfg.sector_size;
    810         if (user_fs_size < 1024 * 1024) {
     810        if (user_fs_size > 0 && user_fs_size < 1024 * 1024) {
    811811                printf(NAME ": Error, fs size can't be less"
    812812                    " than 1 Mb.\n");
     
    824824        if (rc != EOK) {
    825825                printf(NAME ": Warning, failed to obtain" \
    826                     " device block size.\n");
    827                 return 1;
     826                    " block device size.\n");
     827
     828                if (user_fs_size == 0) {
     829                        printf(NAME ": You must specify the" \
     830                            " filesystem size.\n");
     831                        return 1;
     832                }
    828833        } else {
    829834                printf("Block device has %" PRIuOFF64 " blocks.\n",
Note: See TracChangeset for help on using the changeset viewer.