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