fdisk: do not print error message when partition reordering is not needed
Option 'f' currently prints following RED error message: Nothing to do. Ordering is correct already. Failed to fix partitions order. This change removes RED error message when ordering is already correct. Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
This commit is contained in:
parent
ee3d6b0d4a
commit
d501259161
|
@ -636,10 +636,17 @@ static int generic_menu_cb(struct fdisk_context **cxt0,
|
|||
break;
|
||||
case 'f':
|
||||
rc = fdisk_reorder_partitions(cxt);
|
||||
if (rc)
|
||||
switch (rc) {
|
||||
default:
|
||||
fdisk_warnx(cxt, _("Failed to fix partitions order."));
|
||||
else
|
||||
break;
|
||||
case 0:
|
||||
fdisk_info(cxt, _("Partitions order fixed."));
|
||||
break;
|
||||
case 1:
|
||||
fdisk_info(cxt, _("Nothing to do. Ordering is correct already."));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'r':
|
||||
rc = fdisk_enable_details(cxt, 0);
|
||||
|
|
|
@ -2442,10 +2442,8 @@ static int dos_reorder(struct fdisk_context *cxt)
|
|||
struct pte *pei, *pek;
|
||||
size_t i,k;
|
||||
|
||||
if (!wrong_p_order(cxt, NULL)) {
|
||||
fdisk_info(cxt, _("Nothing to do. Ordering is correct already."));
|
||||
if (!wrong_p_order(cxt, NULL))
|
||||
return 1;
|
||||
}
|
||||
|
||||
while ((i = wrong_p_order(cxt, &k)) != 0 && i < 4) {
|
||||
/* partition i should have come earlier, move it */
|
||||
|
|
|
@ -3097,10 +3097,8 @@ static int gpt_reorder(struct fdisk_context *cxt)
|
|||
(const void *) gpt_get_entry(gpt, i),
|
||||
(const void *) gpt_get_entry(gpt, i + 1)) > 0;
|
||||
|
||||
if (!mess) {
|
||||
fdisk_info(cxt, _("Nothing to do. Ordering is correct already."));
|
||||
if (!mess)
|
||||
return 1;
|
||||
}
|
||||
|
||||
qsort(gpt->ents, nparts, sizeof(struct gpt_entry),
|
||||
gpt_entry_cmp_start);
|
||||
|
|
Loading…
Reference in New Issue