Index: uspace/lib/fdisk/src/fdisk.c
===================================================================
--- uspace/lib/fdisk/src/fdisk.c	(revision fe8961db047fff7f6f3e5cb6cd8dd148c78821e6)
+++ uspace/lib/fdisk/src/fdisk.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -46,14 +46,14 @@
 #include <vol.h>
 
-static int fdisk_dev_add_parts(fdisk_dev_t *);
+static errno_t fdisk_dev_add_parts(fdisk_dev_t *);
 static void fdisk_dev_remove_parts(fdisk_dev_t *);
-static int fdisk_part_spec_prepare(fdisk_dev_t *, fdisk_part_spec_t *,
+static errno_t fdisk_part_spec_prepare(fdisk_dev_t *, fdisk_part_spec_t *,
     vbd_part_spec_t *);
 static void fdisk_pri_part_insert_lists(fdisk_dev_t *, fdisk_part_t *);
 static void fdisk_log_part_insert_lists(fdisk_dev_t *, fdisk_part_t *);
-static int fdisk_update_dev_info(fdisk_dev_t *);
+static errno_t fdisk_update_dev_info(fdisk_dev_t *);
 static uint64_t fdisk_ba_align_up(fdisk_dev_t *, uint64_t);
 static uint64_t fdisk_ba_align_down(fdisk_dev_t *, uint64_t);
-static int fdisk_part_get_max_free_range(fdisk_dev_t *, fdisk_spc_t, aoff64_t *,
+static errno_t fdisk_part_get_max_free_range(fdisk_dev_t *, fdisk_spc_t, aoff64_t *,
     aoff64_t *);
 static void fdisk_free_range_first(fdisk_dev_t *, fdisk_spc_t, fdisk_free_range_t *);
@@ -70,8 +70,8 @@
 }
 
-int fdisk_create(fdisk_t **rfdisk)
+errno_t fdisk_create(fdisk_t **rfdisk)
 {
 	fdisk_t *fdisk = NULL;
-	int rc;
+	errno_t rc;
 
 	fdisk = calloc(1, sizeof(fdisk_t));
@@ -111,5 +111,5 @@
 }
 
-int fdisk_dev_list_get(fdisk_t *fdisk, fdisk_dev_list_t **rdevlist)
+errno_t fdisk_dev_list_get(fdisk_t *fdisk, fdisk_dev_list_t **rdevlist)
 {
 	fdisk_dev_list_t *devlist = NULL;
@@ -117,5 +117,5 @@
 	service_id_t *svcs = NULL;
 	size_t count, i;
-	int rc;
+	errno_t rc;
 
 	devlist = calloc(1, sizeof(fdisk_dev_list_t));
@@ -199,8 +199,8 @@
 }
 
-int fdisk_dev_info_get_svcname(fdisk_dev_info_t *info, char **rname)
+errno_t fdisk_dev_info_get_svcname(fdisk_dev_info_t *info, char **rname)
 {
 	char *name;
-	int rc;
+	errno_t rc;
 
 	if (info->svcname == NULL) {
@@ -219,8 +219,8 @@
 }
 
-int fdisk_dev_info_capacity(fdisk_dev_info_t *info, cap_spec_t *cap)
+errno_t fdisk_dev_info_capacity(fdisk_dev_info_t *info, cap_spec_t *cap)
 {
 	vbd_disk_info_t vinfo;
-	int rc;
+	errno_t rc;
 
 	rc = vbd_disk_info(info->devlist->fdisk->vbd, info->svcid, &vinfo);
@@ -233,5 +233,5 @@
 
 /** Add partition to our inventory. */
-static int fdisk_part_add(fdisk_dev_t *dev, vbd_part_id_t partid,
+static errno_t fdisk_part_add(fdisk_dev_t *dev, vbd_part_id_t partid,
     fdisk_part_t **rpart)
 {
@@ -239,5 +239,5 @@
 	vbd_part_info_t pinfo;
 	vol_part_info_t vpinfo;
-	int rc;
+	errno_t rc;
 
 	part = calloc(1, sizeof(fdisk_part_t));
@@ -381,9 +381,9 @@
 }
 
-static int fdisk_dev_add_parts(fdisk_dev_t *dev)
+static errno_t fdisk_dev_add_parts(fdisk_dev_t *dev)
 {
 	service_id_t *psids = NULL;
 	size_t nparts, i;
-	int rc;
+	errno_t rc;
 
 	rc = fdisk_update_dev_info(dev);
@@ -424,10 +424,10 @@
 }
 
-int fdisk_dev_open(fdisk_t *fdisk, service_id_t sid, fdisk_dev_t **rdev)
+errno_t fdisk_dev_open(fdisk_t *fdisk, service_id_t sid, fdisk_dev_t **rdev)
 {
 	fdisk_dev_t *dev = NULL;
 	service_id_t *psids = NULL;
 	size_t nparts, i;
-	int rc;
+	errno_t rc;
 
 	dev = calloc(1, sizeof(fdisk_dev_t));
@@ -479,8 +479,8 @@
 
 /** Erase contents of unlabeled disk. */
-int fdisk_dev_erase(fdisk_dev_t *dev)
+errno_t fdisk_dev_erase(fdisk_dev_t *dev)
 {
 	fdisk_part_t *part;
-	int rc;
+	errno_t rc;
 
 	if (dev->dinfo.ltype != lt_none)
@@ -523,8 +523,8 @@
 }
 
-int fdisk_dev_get_svcname(fdisk_dev_t *dev, char **rname)
+errno_t fdisk_dev_get_svcname(fdisk_dev_t *dev, char **rname)
 {
 	char *name;
-	int rc;
+	errno_t rc;
 
 	rc = loc_service_get_name(dev->sid, &name);
@@ -536,5 +536,5 @@
 }
 
-int fdisk_dev_capacity(fdisk_dev_t *dev, cap_spec_t *cap)
+errno_t fdisk_dev_capacity(fdisk_dev_t *dev, cap_spec_t *cap)
 {
 	cap_from_blocks(dev->dinfo.nblocks, dev->dinfo.block_size, cap);
@@ -542,10 +542,10 @@
 }
 
-int fdisk_label_get_info(fdisk_dev_t *dev, fdisk_label_info_t *info)
+errno_t fdisk_label_get_info(fdisk_dev_t *dev, fdisk_label_info_t *info)
 {
 	vbd_disk_info_t vinfo;
 	uint64_t b0, nb;
 	uint64_t hdrb;
-	int rc;
+	errno_t rc;
 
 	rc = vbd_disk_info(dev->fdisk->vbd, dev->sid, &vinfo);
@@ -580,8 +580,8 @@
 }
 
-int fdisk_label_create(fdisk_dev_t *dev, label_type_t ltype)
+errno_t fdisk_label_create(fdisk_dev_t *dev, label_type_t ltype)
 {
 	fdisk_part_t *part;
-	int rc;
+	errno_t rc;
 
 	/* Disk must not contain a label. */
@@ -612,9 +612,9 @@
 }
 
-int fdisk_label_destroy(fdisk_dev_t *dev)
+errno_t fdisk_label_destroy(fdisk_dev_t *dev)
 {
 	fdisk_part_t *part;
 	fdisk_dev_flags_t dflags;
-	int rc;
+	errno_t rc;
 
 	part = fdisk_part_first(dev);
@@ -667,5 +667,5 @@
 }
 
-int fdisk_part_get_info(fdisk_part_t *part, fdisk_part_info_t *info)
+errno_t fdisk_part_get_info(fdisk_part_t *part, fdisk_part_info_t *info)
 {
 	info->capacity = part->capacity;
@@ -678,7 +678,7 @@
 
 /** Get size of largest free block. */
-int fdisk_part_get_max_avail(fdisk_dev_t *dev, fdisk_spc_t spc, cap_spec_t *cap)
-{
-	int rc;
+errno_t fdisk_part_get_max_avail(fdisk_dev_t *dev, fdisk_spc_t spc, cap_spec_t *cap)
+{
+	errno_t rc;
 	uint64_t b0;
 	uint64_t nb;
@@ -702,5 +702,5 @@
 
 /** Get total free space capacity. */
-int fdisk_part_get_tot_avail(fdisk_dev_t *dev, fdisk_spc_t spc,
+errno_t fdisk_part_get_tot_avail(fdisk_dev_t *dev, fdisk_spc_t spc,
     cap_spec_t *cap)
 {
@@ -729,5 +729,5 @@
 }
 
-int fdisk_part_create(fdisk_dev_t *dev, fdisk_part_spec_t *pspec,
+errno_t fdisk_part_create(fdisk_dev_t *dev, fdisk_part_spec_t *pspec,
     fdisk_part_t **rpart)
 {
@@ -737,5 +737,5 @@
 	vol_part_info_t vpinfo;
 	const char *label;
-	int rc;
+	errno_t rc;
 
 	label = pspec->label != NULL ? pspec->label : "";
@@ -796,7 +796,7 @@
 }
 
-int fdisk_part_destroy(fdisk_part_t *part)
-{
-	int rc;
+errno_t fdisk_part_destroy(fdisk_part_t *part)
+{
+	errno_t rc;
 
 	rc = vbd_part_delete(part->dev->fdisk->vbd, part->part_id);
@@ -813,5 +813,5 @@
 }
 
-int fdisk_ltype_format(label_type_t ltype, char **rstr)
+errno_t fdisk_ltype_format(label_type_t ltype, char **rstr)
 {
 	const char *sltype;
@@ -839,5 +839,5 @@
 }
 
-int fdisk_fstype_format(vol_fstype_t fstype, char **rstr)
+errno_t fdisk_fstype_format(vol_fstype_t fstype, char **rstr)
 {
 	const char *sfstype;
@@ -871,5 +871,5 @@
 }
 
-int fdisk_pkind_format(label_pkind_t pkind, char **rstr)
+errno_t fdisk_pkind_format(label_pkind_t pkind, char **rstr)
 {
 	const char *spkind;
@@ -898,5 +898,5 @@
 
 /** Get free partition index. */
-static int fdisk_part_get_free_idx(fdisk_dev_t *dev, int *rindex)
+static errno_t fdisk_part_get_free_idx(fdisk_dev_t *dev, int *rindex)
 {
 	link_t *link;
@@ -926,5 +926,5 @@
  * Get free range of blocks of at least the specified size (first fit).
  */
-static int fdisk_part_get_free_range(fdisk_dev_t *dev, aoff64_t nblocks,
+static errno_t fdisk_part_get_free_range(fdisk_dev_t *dev, aoff64_t nblocks,
     fdisk_spc_t spc, aoff64_t *rblock0, aoff64_t *rnblocks)
 {
@@ -952,5 +952,5 @@
  * Get free range of blocks of the maximum size.
  */
-static int fdisk_part_get_max_free_range(fdisk_dev_t *dev, fdisk_spc_t spc,
+static errno_t fdisk_part_get_max_free_range(fdisk_dev_t *dev, fdisk_spc_t spc,
     aoff64_t *rblock0, aoff64_t *rnblocks)
 {
@@ -981,5 +981,5 @@
 
 /** Prepare new partition specification for VBD. */
-static int fdisk_part_spec_prepare(fdisk_dev_t *dev, fdisk_part_spec_t *pspec,
+static errno_t fdisk_part_spec_prepare(fdisk_dev_t *dev, fdisk_part_spec_t *pspec,
     vbd_part_spec_t *vpspec)
 {
@@ -994,5 +994,5 @@
 	fdisk_spc_t spc;
 	int index;
-	int rc;
+	errno_t rc;
 
 	rc = cap_to_blocks(&pspec->capacity, cv_nom, dev->dinfo.block_size,
@@ -1103,7 +1103,7 @@
 }
 
-static int fdisk_update_dev_info(fdisk_dev_t *dev)
-{
-	int rc;
+static errno_t fdisk_update_dev_info(fdisk_dev_t *dev)
+{
+	errno_t rc;
 	size_t align_bytes;
 	uint64_t avail_cap;
@@ -1223,5 +1223,5 @@
 
 /** Get volume label support. */
-int fdisk_get_vollabel_support(fdisk_dev_t *dev, vol_fstype_t fstype,
+errno_t fdisk_get_vollabel_support(fdisk_dev_t *dev, vol_fstype_t fstype,
     vol_label_supp_t *vlsupp)
 {
