Changes in uspace/app/fdisk/fdisk.c [1433ecda:db9c889] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/fdisk/fdisk.c
r1433ecda rdb9c889 37 37 #include <cap.h> 38 38 #include <errno.h> 39 #include <fdisk.h> 40 #include <io/label.h> 39 41 #include <nchoice.h> 40 42 #include <stdbool.h> 41 43 #include <stdio.h> 42 44 #include <stdlib.h> 43 #include <fdisk.h>44 45 #include <str.h> 46 #include <vol.h> 45 47 46 48 #define NO_LABEL_CAPTION "(No name)" … … 69 71 } devac_t; 70 72 71 static errno_t fdsk_pcnt_fs_format(vol_part_cnt_t pcnt, vol_fstype_t fstype,72 char **rstr)73 {74 errno_t rc;75 char *s;76 77 switch (pcnt) {78 case vpc_empty:79 s = str_dup("Empty");80 if (s == NULL)81 return ENOMEM;82 break;83 case vpc_fs:84 rc = fdisk_fstype_format(fstype, &s);85 if (rc != EOK)86 return ENOMEM;87 break;88 case vpc_unknown:89 s = str_dup("Unknown");90 if (s == NULL)91 return ENOMEM;92 break;93 }94 95 *rstr = s;96 return EOK;97 }98 99 73 /** Confirm user selection. */ 100 74 static errno_t fdsk_confirm(const char *msg, bool *rconfirm) … … 305 279 306 280 for (i = LT_FIRST; i < LT_LIMIT; i++) { 307 rc = fdisk_ltype_format(i, &sltype);281 rc = label_type_format(i, &sltype); 308 282 if (rc != EOK) 309 283 goto error; … … 413 387 414 388 for (i = 0; i < VOL_FSTYPE_LIMIT; i++) { 415 rc = fdisk_fstype_format(i, &sfstype);389 rc = vol_fstype_format(i, &sfstype); 416 390 if (rc != EOK) 417 391 goto error; … … 598 572 } 599 573 600 rc = fdisk_pkind_format(pinfo.pkind, &spkind);574 rc = label_pkind_format(pinfo.pkind, &spkind); 601 575 if (rc != EOK) { 602 576 printf("\nOut of memory.\n"); … … 605 579 606 580 if (pinfo.pkind != lpk_extended) { 607 rc = fdsk_pcnt_fs_format(pinfo.pcnt, pinfo.fstype, &sfstype);581 rc = vol_pcnt_fs_format(pinfo.pcnt, pinfo.fstype, &sfstype); 608 582 if (rc != EOK) { 609 583 printf("Out of memory.\n"); … … 773 747 break; 774 748 default: 775 rc = fdisk_ltype_format(linfo.ltype, &sltype);749 rc = label_type_format(linfo.ltype, &sltype); 776 750 if (rc != EOK) { 777 751 assert(rc == ENOMEM); … … 804 778 } 805 779 806 rc = fdsk_pcnt_fs_format(pinfo.pcnt, pinfo.fstype, &sfstype);780 rc = vol_pcnt_fs_format(pinfo.pcnt, pinfo.fstype, &sfstype); 807 781 if (rc != EOK) { 808 782 printf("Out of memory.\n"); … … 821 795 822 796 if ((linfo.flags & lf_ext_supp) != 0) { 823 rc = fdisk_pkind_format(pinfo.pkind, &spkind);797 rc = label_pkind_format(pinfo.pkind, &spkind); 824 798 if (rc != EOK) { 825 799 printf("\nOut of memory.\n");
Note:
See TracChangeset
for help on using the changeset viewer.