Changeset ea0ff6b in mainline for uspace/app/fdisk/fdisk.c
- Timestamp:
- 2015-10-15T20:43:30Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 44fe800
- Parents:
- edebb4a1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/fdisk/fdisk.c
redebb4a1 rea0ff6b 51 51 /** Delete label */ 52 52 devac_delete_label, 53 /** Erase disk */ 54 devac_erase_disk, 53 55 /** Create (primary) partition */ 54 56 devac_create_pri_part, … … 262 264 } 263 265 266 static int fdsk_erase_disk(fdisk_dev_t *dev) 267 { 268 int rc; 269 270 rc = fdisk_dev_erase(dev); 271 if (rc != EOK) { 272 printf("Error erasing disk.\n"); 273 return rc; 274 } 275 276 return EOK; 277 } 278 264 279 static int fdsk_select_fstype(vol_fstype_t *fstype) 265 280 { … … 473 488 fdisk_part_info_t pinfo; 474 489 fdisk_cap_t cap; 490 fdisk_dev_flags_t dflags; 475 491 char *sltype = NULL; 476 492 char *sdcap = NULL; … … 514 530 goto error; 515 531 } 532 533 fdisk_dev_get_flags(dev, &dflags); 516 534 517 535 printf("Device: %s, %s\n", sdcap, svcname); … … 667 685 } 668 686 669 if ( linfo.ltype == lt_none) {687 if ((dflags & fdf_can_create_label) != 0) { 670 688 rc = nchoice_add(choice, "Create label", 671 689 (void *)devac_create_label); … … 675 693 goto error; 676 694 } 677 } else { 695 } 696 697 if ((dflags & fdf_can_delete_label) != 0) { 678 698 rc = nchoice_add(choice, "Delete label", 679 699 (void *)devac_delete_label); 700 if (rc != EOK) { 701 assert(rc == ENOMEM); 702 printf("Out of memory.\n"); 703 goto error; 704 } 705 } 706 707 if ((dflags & fdf_can_erase_dev) != 0) { 708 rc = nchoice_add(choice, "Erase disk", 709 (void *)devac_erase_disk); 680 710 if (rc != EOK) { 681 711 assert(rc == ENOMEM); … … 704 734 case devac_delete_label: 705 735 (void) fdsk_delete_label(dev); 736 break; 737 case devac_erase_disk: 738 (void) fdsk_erase_disk(dev); 706 739 break; 707 740 case devac_create_pri_part:
Note:
See TracChangeset
for help on using the changeset viewer.