From 015db5800ca7c6dd2d201eacb2951e72e6782b30 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 19 Jun 2016 18:15:33 +0200 Subject: randomconfig fixes Signed-off-by: Denys Vlasenko --- util-linux/fbset.c | 5 +++-- util-linux/fdisk_osf.c | 3 ++- util-linux/fdisk_sgi.c | 27 +++++++++++++++------------ 3 files changed, 20 insertions(+), 15 deletions(-) (limited to 'util-linux') diff --git a/util-linux/fbset.c b/util-linux/fbset.c index 09e96b7..b75ec19 100644 --- a/util-linux/fbset.c +++ b/util-linux/fbset.c @@ -164,6 +164,7 @@ static const struct cmdoptions_t { const unsigned char code; } g_cmdoptions[] = { /*"12345678" + NUL */ +//TODO: convert to index_in_strings() { "fb" , 1, CMD_FB }, { "db" , 1, CMD_DB }, { "a" , 0, CMD_ALL }, @@ -416,7 +417,7 @@ int fbset_main(int argc, char **argv) unsigned options = 0; const char *fbdev = DEFAULTFBDEV; - const char *modefile = DEFAULTFBMODE; + IF_FEATURE_FBSET_READMODE(const char *modefile = DEFAULTFBMODE;) char *thisarg; char *mode = mode; /* for compiler */ @@ -444,7 +445,7 @@ int fbset_main(int argc, char **argv) fbdev = argv[1]; break; case CMD_DB: - modefile = argv[1]; + IF_FEATURE_FBSET_READMODE(modefile = argv[1];) break; case CMD_ALL: options |= OPT_ALL; diff --git a/util-linux/fdisk_osf.c b/util-linux/fdisk_osf.c index af04cfc..89f1f32 100644 --- a/util-linux/fdisk_osf.c +++ b/util-linux/fdisk_osf.c @@ -366,10 +366,11 @@ bsd_select(void) } printf("Reading disklabel of %s at sector %u\n", partname(disk_device, t+1, 0), ss + BSD_LABELSECTOR); - if (xbsd_readlabel(xbsd_part) == 0) + if (xbsd_readlabel(xbsd_part) == 0) { if (xbsd_create_disklabel() == 0) return; break; + } } } diff --git a/util-linux/fdisk_sgi.c b/util-linux/fdisk_sgi.c index 23ebc56..30def09 100644 --- a/util-linux/fdisk_sgi.c +++ b/util-linux/fdisk_sgi.c @@ -504,17 +504,19 @@ verify_sgi(int verbose) if (sgi_get_sysid(Index[0]) == SGI_ENTIRE_DISK) { if ((Index[0] != 10) && verbose) printf("IRIX likes when Partition 11 covers the entire disk\n"); - if ((sgi_get_start_sector(Index[0]) != 0) && verbose) + if ((sgi_get_start_sector(Index[0]) != 0) && verbose) { printf("The entire disk partition should start " "at block 0,\n" "not at diskblock %u\n", sgi_get_start_sector(Index[0])); - if (SGI_DEBUG) /* I do not understand how some disks fulfil it */ + } + if (SGI_DEBUG) { /* I do not understand how some disks fulfil it */ if ((sgi_get_num_sectors(Index[0]) != lastblock) && verbose) printf("The entire disk partition is only %u diskblock large,\n" "but the disk is %u diskblocks long\n", sgi_get_num_sectors(Index[0]), lastblock); lastblock = sgi_get_num_sectors(Index[0]); + } } else { if (verbose) printf("One Partition (#11) should cover the entire disk\n"); @@ -669,16 +671,17 @@ sgi_set_volhdr(void) int n; for (n = 8; n < g_partitions; n++) { - if (!sgi_get_num_sectors(n)) { - /* - * 5 cylinders is an arbitrary value I like - * IRIX 5.3 stored files in the volume header - * (like sash, symmon, fx, ide) with ca. 3200 - * sectors. - */ - if (g_heads * g_sectors * 5 < sgi_get_lastblock()) - sgi_set_partition(n, 0, g_heads * g_sectors * 5, SGI_VOLHDR); - break; + if (!sgi_get_num_sectors(n)) { + /* + * 5 cylinders is an arbitrary value I like + * IRIX 5.3 stored files in the volume header + * (like sash, symmon, fx, ide) with ca. 3200 + * sectors. + */ + if (g_heads * g_sectors * 5 < sgi_get_lastblock()) { + sgi_set_partition(n, 0, g_heads * g_sectors * 5, SGI_VOLHDR); + break; + } } } } -- cgit v1.1