From 70f67d724b805bbe1c420af9081808d7091d748d Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Fri, 1 Oct 2010 03:12:15 +0200 Subject: [PATCH] installer: Clean up check_capacity() (UFS) a bit and improve the message. --- .../dfuibe_installer/fn_subpart_ufs.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/usr.sbin/installer/dfuibe_installer/fn_subpart_ufs.c b/usr.sbin/installer/dfuibe_installer/fn_subpart_ufs.c index a8b68d7d85..ebda498234 100644 --- a/usr.sbin/installer/dfuibe_installer/fn_subpart_ufs.c +++ b/usr.sbin/installer/dfuibe_installer/fn_subpart_ufs.c @@ -277,19 +277,24 @@ check_capacity(struct i_fn_args *a) for (sp = slice_subpartition_first(storage_get_selected_slice(a->s)); sp != NULL; sp = subpartition_next(sp)) { - if (subpartition_get_capacity(sp) == -1) + long subpart_capacity = subpartition_get_capacity(sp); + const char *mountpt = subpartition_get_mountpoint(sp); + + if (subpart_capacity == -1) total_capacity++; else - total_capacity += subpartition_get_capacity(sp); + total_capacity += subpart_capacity; for (mtpt = 0; def_mountpt[mtpt] != NULL; mtpt++) { - if (strcmp(subpartition_get_mountpoint(sp), def_mountpt[mtpt]) == 0 && + if (strcmp(mountpt, def_mountpt[mtpt]) == 0 && min_capacity[mtpt] > 0 && - subpartition_get_capacity(sp) < min_capacity[mtpt]) { - inform(a->c, _("WARNING: the %s subpartition should " - "be at least %dM in size or you will " + subpart_capacity < min_capacity[mtpt]) { + inform(a->c, _("WARNING: The size (%ldM) specified for " + "the %s subpartition is too small. It " + "should be at least %ldM or you will " "risk running out of space during " "the installation."), - subpartition_get_mountpoint(sp), min_capacity[mtpt]); + subpart_capacity, mountpt, + min_capacity[mtpt]); } } } -- 2.41.0