Changeset 84239b1 in mainline for uspace/app/mkexfat/mkexfat.c


Ignore:
Timestamp:
2018-03-11T19:39:11Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f3d47c97
Parents:
850fd32
Message:

And there was much fixing.

File:
1 edited

Legend:

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

    r850fd32 r84239b1  
    680680        unsigned r;
    681681
    682         for (r = 0;n >> r != 1; ++r);
     682        r = 0;
     683        while (n >> r != 1)
     684                ++r;
    683685
    684686        return r;
     
    771773        cfg.label = NULL;
    772774
    773         for (c = 0, optind = 0, opt_ind = 0; c != -1;) {
     775        c = 0;
     776        optind = 0;
     777        opt_ind = 0;
     778        while (c != -1) {
    774779                c = getopt_long(argc, argv, "hs:c:L:",
    775780                    long_options, &opt_ind);
     
    845850
    846851        if (cfg.sector_size > 4096) {
    847                 printf(NAME ": Error, sector size can't be greater" \
     852                printf(NAME ": Error, sector size can't be greater"
    848853                    " than 4096 bytes.\n");
    849854                return 2;
     
    852857        rc = block_get_nblocks(service_id, &cfg.volume_count);
    853858        if (rc != EOK) {
    854                 printf(NAME ": Warning, failed to obtain" \
     859                printf(NAME ": Warning, failed to obtain"
    855860                    " block device size.\n");
    856861
    857862                if (user_fs_size == 0) {
    858                         printf(NAME ": You must specify the" \
     863                        printf(NAME ": You must specify the"
    859864                            " filesystem size.\n");
    860865                        return 1;
     
    897902            div_round_up(cfg.bitmap_size, cfg.cluster_size));
    898903        if (rc != EOK) {
    899                 printf(NAME ": Error, failed to allocate" \
     904                printf(NAME ": Error, failed to allocate"
    900905                    " clusters for bitmap.\n");
    901906                return 2;
     
    910915            div_round_up(sizeof(upcase_table), cfg.cluster_size));
    911916        if (rc != EOK) {
    912                 printf(NAME ":Error, failed to allocate clusters" \
     917                printf(NAME ":Error, failed to allocate clusters"
    913918                    " for the upcase table.\n");
    914919                return 2;
     
    921926        rc = fat_allocate_clusters(service_id, &cfg, next_cls, 1);
    922927        if (rc != EOK) {
    923                 printf(NAME ": Error, failed to allocate cluster" \
     928                printf(NAME ": Error, failed to allocate cluster"
    924929                    " for the root dentry.\n");
    925930                return 2;
     
    931936        rc = bitmap_write(service_id, &cfg);
    932937        if (rc != EOK) {
    933                 printf(NAME ": Error, failed to write the allocation" \
     938                printf(NAME ": Error, failed to write the allocation"
    934939                    " bitmap to disk.\n");
    935940                return 2;
     
    941946        rc = upcase_table_write(service_id, &cfg);
    942947        if (rc != EOK) {
    943                 printf(NAME ": Error, failed to write the" \
     948                printf(NAME ": Error, failed to write the"
    944949                    " upcase table to disk.\n");
    945950                return 2;
     
    950955        rc = root_dentries_write(service_id, &cfg);
    951956        if (rc != EOK) {
    952                 printf(NAME ": Error, failed to write the root directory" \
     957                printf(NAME ": Error, failed to write the root directory"
    953958                    " entries to disk.\n");
    954959                return 2;
Note: See TracChangeset for help on using the changeset viewer.