static int xbsd_initlabel(struct fdisk_context *cxt);
static int xbsd_readlabel(struct fdisk_context *cxt);
static int xbsd_writelabel(struct fdisk_context *cxt);
-static void sync_disks (void);
+static void sync_disks(struct fdisk_context *cxt);
#if defined (__alpha__)
void alpha_bootblock_checksum (char *boot);
ss = dos_partition_get_start(l->dos_part);
if (!ss) {
- fprintf (stderr, _("Partition %zd: has invalid starting sector 0.\n"), i + 1);
+ fdisk_warnx(cxt, _("Partition %zd: has invalid starting "
+ "sector 0."), i + 1);
return -1;
}
return 0;
}
- printf (_("There is no *BSD partition on %s.\n"), cxt->parent->dev_path);
+ fdisk_warnx(cxt, _("There is no *BSD partition on %s."),
+ cxt->parent->dev_path);
free(cxt->dev_path);
cxt->dev_path = NULL;
l->dos_part = NULL;
static int xbsd_write_disklabel (struct fdisk_context *cxt)
{
- printf (_("Writing disklabel to %s.\n"), cxt->dev_path);
+ fdisk_info(cxt, _("Writing disklabel to %s."), cxt->dev_path);
xbsd_writelabel(cxt);
reread_partition_table(cxt, 0); /* no exit yet */
return 0;
}
fdisk_info(cxt, _("Bootstrap installed on %s."), cxt->dev_path);
- sync_disks ();
+ sync_disks(cxt);
rc = 0;
done:
break;
if (t == BSD_MAXPARTITIONS) {
- fprintf (stderr, _("The maximum number of partitions "
- "has been created\n"));
+ fdisk_warnx(cxt, _("The maximum number of partitions "
+ "has been created."));
return -EINVAL;
}
}
d->d_npartitions = (*i) + 1;
if (d->d_partitions[*i].p_size != 0) {
- fprintf (stderr, _("This partition already exists.\n"));
+ fdisk_warnx(cxt, ("This partition already exists."));
return -EINVAL;
}
fdisk_warn(cxt, _("write failed: %d"), cxt->dev_path);
return -errno;
}
- sync_disks ();
+ sync_disks(cxt);
return 0;
}
-static void
-sync_disks (void)
+static void sync_disks(struct fdisk_context *cxt)
{
- printf (_("\nSyncing disks.\n"));
- sync ();
- sleep (4);
+ fdisk_info(cxt, _("Syncing disks."));
+ sync();
+ sleep(4);
}
#if !defined (__alpha__)