Changeset 9bda5d90 in mainline for uspace/app/hdisk/func_mbr.c


Ignore:
Timestamp:
2013-05-03T01:20:11Z (12 years ago)
Author:
Dominik Taborsky (AT DOT) <brembyseznamcz>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
469739f, c9f61150, f6c8fca
Parents:
700f89e
Message:

libmbr final

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/hdisk/func_mbr.c

    r700f89e r9bda5d90  
    6868        printf("Number of the partition to delete (counted from 0): ");
    6969        idx = get_input_size_t(in);
    70 
     70       
     71        if (idx == 0 && errno != EOK)
     72                return errno;
     73       
    7174        rc = mbr_remove_partition(data->mbr.parts, idx);
    7275        if(rc != EOK) {
     
    8184        data->mbr.mbr = mbr_alloc_mbr();
    8285        data->mbr.parts = mbr_alloc_partitions();
     86        return EOK;
    8387}
    8488
     
    103107                        printf(" ");
    104108
    105                 printf("\t%10u %10u %10u %7x\n", it->start_addr, it->start_addr + it->length, it->length, it->type);
     109                printf("\t%10u %10u %10u %7u\n", it->start_addr, it->start_addr + it->length, it->length, it->type);
    106110
    107111                ++num;
     
    109113
    110114        printf("%d partitions found.\n", num);
    111         printf("DEBUG: primary: %hhu, logical: %u\n", data->mbr.parts->n_primary, data->mbr.parts->n_logical);
    112115       
    113116        return EOK;
     
    126129int extra_mbr_funcs(tinput_t * in, service_id_t dev_handle, union table_data * data)
    127130{
     131        printf("Not implemented.\n");
    128132        return EOK;
    129133}
     
    152156        printf("Set type (0-255): ");
    153157        type = get_input_uint8(in);
     158        if (type == 0 && errno != EOK)
     159                return errno;
    154160
    155161        ///TODO: there can only be one bootable partition; let's do it just like fdisk
     
    168174        printf("Set starting address (number): ");
    169175        sa = get_input_uint32(in);
     176        if (sa == 0 && errno != EOK)
     177                return errno;
    170178
    171179        printf("Set end addres (number): ");
    172180        ea = get_input_uint32(in);
     181        if (ea == 0 && errno != EOK)
     182                return errno;
    173183       
    174184        if(ea < sa) {
Note: See TracChangeset for help on using the changeset viewer.