Changeset 0ecfc62 in mainline for uspace/app/fdisk/fdisk.c
- Timestamp:
- 2015-10-09T18:11:08Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3a43785
- Parents:
- 372df8f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/fdisk/fdisk.c
r372df8f r0ecfc62 525 525 } 526 526 527 switch (linfo. dcnt) {528 case dc_empty:529 printf("Disk is empty.\n");530 break; 531 case dc_label:527 switch (linfo.ltype) { 528 case lt_none: 529 printf("Disk contains no label.\n"); 530 break; 531 default: 532 532 rc = fdisk_ltype_format(linfo.ltype, &sltype); 533 533 if (rc != EOK) { … … 540 540 free(sltype); 541 541 sltype = NULL; 542 break;543 case dc_fs:544 printf("Disk contains a file system.\n");545 break;546 case dc_unknown:547 printf("Disk contains unknown data.\n");548 542 break; 549 543 } … … 602 596 } 603 597 604 if (linfo.dcnt == dc_label) { 605 if ((linfo.flags & lf_ext_supp) != 0) { 606 if ((linfo.flags & lf_can_create_pri) != 0) { 607 rc = nchoice_add(choice, "Create primary " 608 "partition", 609 (void *)devac_create_pri_part); 610 if (rc != EOK) { 611 assert(rc == ENOMEM); 598 if ((linfo.flags & lf_ext_supp) != 0) { 599 if ((linfo.flags & lf_can_create_pri) != 0) { 600 rc = nchoice_add(choice, "Create primary " 601 "partition", 602 (void *)devac_create_pri_part); 603 if (rc != EOK) { 604 assert(rc == ENOMEM); 605 printf("Out of memory.\n"); 606 goto error; 607 } 608 } 609 610 if ((linfo.flags & lf_can_create_ext) != 0) { 611 rc = nchoice_add(choice, "Create extended " 612 "partition", 613 (void *)devac_create_ext_part); 614 if (rc != EOK) { 615 assert(rc == ENOMEM); 616 printf("Out of memory.\n"); 617 goto error; 618 } 619 } 620 621 if ((linfo.flags & lf_can_create_log) != 0) { 622 rc = nchoice_add(choice, "Create logical " 623 "partition", 624 (void *)devac_create_log_part); 625 if (rc != EOK) { 626 assert(rc == ENOMEM); 627 printf("Out of memory.\n"); 628 goto error; 629 } 630 } 631 } else { /* (linfo.flags & lf_ext_supp) == 0 */ 632 if ((linfo.flags & lf_can_create_pri) != 0) { 633 rc = nchoice_add(choice, "Create partition", 634 (void *)devac_create_pri_part); 635 if (rc != EOK) { 636 assert(rc == ENOMEM); 612 637 printf("Out of memory.\n"); 613 638 goto error; 614 639 } 615 }616 617 if ((linfo.flags & lf_can_create_ext) != 0) {618 rc = nchoice_add(choice, "Create extended "619 "partition",620 (void *)devac_create_ext_part);621 if (rc != EOK) {622 assert(rc == ENOMEM);623 printf("Out of memory.\n");624 goto error;625 }626 }627 628 if ((linfo.flags & lf_can_create_log) != 0) {629 rc = nchoice_add(choice, "Create logical "630 "partition",631 (void *)devac_create_log_part);632 if (rc != EOK) {633 assert(rc == ENOMEM);634 printf("Out of memory.\n");635 goto error;636 }637 }638 } else { /* (linfo.flags & lf_ext_supp) == 0 */639 if ((linfo.flags & lf_can_create_pri) != 0) {640 rc = nchoice_add(choice, "Create partition",641 (void *)devac_create_pri_part);642 if (rc != EOK) {643 assert(rc == ENOMEM);644 printf("Out of memory.\n");645 goto error;646 }647 }648 640 } 649 641 } … … 659 651 } 660 652 661 if (linfo. dcnt == dc_empty) {653 if (linfo.ltype == lt_none) { 662 654 rc = nchoice_add(choice, "Create label", 663 655 (void *)devac_create_label);
Note:
See TracChangeset
for help on using the changeset viewer.