Changes in uspace/app/fdisk/fdisk.c [6c4eedf:1d6dd2a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/fdisk/fdisk.c
r6c4eedf r1d6dd2a 42 42 #include <stdlib.h> 43 43 #include <fdisk.h> 44 #include <str.h> 44 45 45 46 #define NO_LABEL_CAPTION "(No name)" … … 68 69 } devac_t; 69 70 70 static int fdsk_pcnt_fs_format(vol_part_cnt_t pcnt, vol_fstype_t fstype,71 static errno_t fdsk_pcnt_fs_format(vol_part_cnt_t pcnt, vol_fstype_t fstype, 71 72 char **rstr) 72 73 { 73 int rc;74 errno_t rc; 74 75 char *s; 75 76 … … 97 98 98 99 /** Confirm user selection. */ 99 static int fdsk_confirm(const char *msg, bool *rconfirm)100 static errno_t fdsk_confirm(const char *msg, bool *rconfirm) 100 101 { 101 102 tinput_t *tinput = NULL; 102 103 char *answer; 103 int rc;104 errno_t rc; 104 105 105 106 tinput = tinput_new(); … … 146 147 147 148 /** Device selection */ 148 static int fdsk_dev_sel_choice(service_id_t *rsvcid)149 static errno_t fdsk_dev_sel_choice(service_id_t *rsvcid) 149 150 { 150 151 fdisk_dev_list_t *devlist = NULL; … … 159 160 void *sel; 160 161 int ndevs; 161 int rc;162 errno_t rc; 162 163 163 164 rc = nchoice_create(&choice); … … 210 211 } 211 212 212 rc= asprintf(&dtext, "%s (%s)", svcname, scap);213 if (r c< 0) {213 int ret = asprintf(&dtext, "%s (%s)", svcname, scap); 214 if (ret < 0) { 214 215 rc = ENOMEM; 215 216 printf("Out of memory.\n"); … … 269 270 return EOK; 270 271 error: 272 assert(rc != EOK); 273 *rsvcid = 0; 271 274 if (devlist != NULL) 272 275 fdisk_dev_list_free(devlist); … … 279 282 } 280 283 281 static int fdsk_create_label(fdisk_dev_t *dev)284 static errno_t fdsk_create_label(fdisk_dev_t *dev) 282 285 { 283 286 nchoice_t *choice = NULL; … … 285 288 char *sltype = NULL; 286 289 int i; 287 int rc;290 errno_t rc; 288 291 289 292 rc = nchoice_create(&choice); … … 339 342 } 340 343 341 static int fdsk_delete_label(fdisk_dev_t *dev)344 static errno_t fdsk_delete_label(fdisk_dev_t *dev) 342 345 { 343 346 bool confirm; 344 int rc;347 errno_t rc; 345 348 346 349 rc = fdsk_confirm("Warning. Any data on disk will be lost. " … … 363 366 } 364 367 365 static int fdsk_erase_disk(fdisk_dev_t *dev)368 static errno_t fdsk_erase_disk(fdisk_dev_t *dev) 366 369 { 367 370 bool confirm; 368 int rc;371 errno_t rc; 369 372 370 373 rc = fdsk_confirm("Warning. Any data on disk will be lost. " … … 387 390 } 388 391 389 static int fdsk_select_fstype(vol_fstype_t *fstype)392 static errno_t fdsk_select_fstype(vol_fstype_t *fstype) 390 393 { 391 394 nchoice_t *choice = NULL; … … 393 396 char *sfstype; 394 397 int i; 395 int rc;398 errno_t rc; 396 399 397 400 rc = nchoice_create(&choice); … … 442 445 } 443 446 444 static int fdsk_create_part(fdisk_dev_t *dev, label_pkind_t pkind)447 static errno_t fdsk_create_part(fdisk_dev_t *dev, label_pkind_t pkind) 445 448 { 446 int rc;449 errno_t rc; 447 450 fdisk_part_spec_t pspec; 448 451 cap_spec_t cap; … … 551 554 } 552 555 553 static int fdsk_delete_part(fdisk_dev_t *dev)556 static errno_t fdsk_delete_part(fdisk_dev_t *dev) 554 557 { 555 558 nchoice_t *choice = NULL; … … 563 566 bool confirm; 564 567 void *sel; 565 int rc;568 errno_t rc; 566 569 567 570 rc = nchoice_create(&choice); … … 613 616 label = "(No name)"; 614 617 615 rc= asprintf(&sdesc, "%s %s, %s, %s", label,618 int ret = asprintf(&sdesc, "%s %s, %s, %s", label, 616 619 scap, spkind, sfstype); 617 if (r c< 0) {620 if (ret < 0) { 618 621 rc = ENOMEM; 619 622 goto error; … … 621 624 622 625 } else { 623 rc= asprintf(&sdesc, "%s, %s", scap, spkind);624 if (r c< 0) {626 int ret = asprintf(&sdesc, "%s, %s", scap, spkind); 627 if (ret < 0) { 625 628 rc = ENOMEM; 626 629 goto error; … … 698 701 699 702 /** Device menu */ 700 static int fdsk_dev_menu(fdisk_dev_t *dev)703 static errno_t fdsk_dev_menu(fdisk_dev_t *dev) 701 704 { 702 705 nchoice_t *choice = NULL; … … 715 718 char *spkind; 716 719 const char *label; 717 int rc;720 errno_t rc; 718 721 int npart; 719 722 void *sel; … … 1077 1080 service_id_t svcid; 1078 1081 fdisk_dev_t *dev; 1079 int rc;1082 errno_t rc; 1080 1083 1081 1084 rc = fdisk_create(&fdisk);
Note:
See TracChangeset
for help on using the changeset viewer.