Skip to content

Commit c2e7cde

Browse files
committed
host/limine: Wrap prints in check-for-quiet blocks where needed
1 parent 4b42bf2 commit c2e7cde

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

host/limine.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -778,25 +778,33 @@ static int bios_install(int argc, char *argv[]) {
778778
}
779779

780780
if (gpt_entry.starting_lba > UINT32_MAX) {
781-
fprintf(stderr, "Starting LBA of partition %zu is greater than UINT32_MAX, will not convert GPT.\n", i + 1);
781+
if (!quiet) {
782+
fprintf(stderr, "Starting LBA of partition %zu is greater than UINT32_MAX, will not convert GPT.\n", i + 1);
783+
}
782784
goto no_mbr_conv;
783785
}
784786
part_to_conv[part_to_conv_i].lba_start = ENDSWAP(gpt_entry.starting_lba);
785787
if (gpt_entry.ending_lba > UINT32_MAX) {
786-
fprintf(stderr, "Ending LBA of partition %zu is greater than UINT32_MAX, will not convert GPT.\n", i + 1);
788+
if (!quiet) {
789+
fprintf(stderr, "Ending LBA of partition %zu is greater than UINT32_MAX, will not convert GPT.\n", i + 1);
790+
}
787791
goto no_mbr_conv;
788792
}
789793
part_to_conv[part_to_conv_i].lba_end = ENDSWAP(gpt_entry.ending_lba);
790794

791795
int type = gpt2mbr_type(ENDSWAP(gpt_entry.partition_type_guid[0]),
792796
ENDSWAP(gpt_entry.partition_type_guid[1]));
793797
if (type == -1) {
794-
fprintf(stderr, "Cannot convert partition type for partition %zu, will not convert GPT.\n", i + 1);
798+
if (!quiet) {
799+
fprintf(stderr, "Cannot convert partition type for partition %zu, will not convert GPT.\n", i + 1);
800+
}
795801
goto no_mbr_conv;
796802
}
797803

798804
if (part_to_conv_i == 4) {
799-
fprintf(stderr, "GPT contains more than 4 partitions, will not convert.\n");
805+
if (!quiet) {
806+
fprintf(stderr, "GPT contains more than 4 partitions, will not convert.\n");
807+
}
800808
goto no_mbr_conv;
801809
}
802810

@@ -839,7 +847,9 @@ static int bios_install(int argc, char *argv[]) {
839847
device_write(&sect_count, 0x1be + i * 16 + 0x0c, 4);
840848
}
841849

842-
fprintf(stderr, "Conversion successful.\n");
850+
if (!quiet) {
851+
fprintf(stderr, "Conversion successful.\n");
852+
}
843853
}
844854

845855
no_mbr_conv:;

0 commit comments

Comments
 (0)