diff options
author | marcel <marcel@FreeBSD.org> | 2013-08-07 00:00:48 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2013-08-07 00:00:48 +0000 |
commit | 9f2f2e171a6de4c6d713a50366f3572946665fb5 (patch) | |
tree | b8704cff2de99c4cf2da972288c8d1271ec33598 /sbin/fdisk_pc98/fdisk.c | |
parent | f5fd32bca5d6cadbe86d031375653c183adce356 (diff) | |
download | FreeBSD-src-9f2f2e171a6de4c6d713a50366f3572946665fb5.zip FreeBSD-src-9f2f2e171a6de4c6d713a50366f3572946665fb5.tar.gz |
Change <sys/diskpc98.h> to not redefine the same symbols that are
being defined in <sys/diskmbr.h>. Instead give the symbols here a
"PC98_" prefix. This way, both <sys/diskmbr.h> and <sys/diskpc98.h>
can be included in the same C source file.
The renaming is trivial. The only gotcha is that DOSBBSECTOR is
also redefined from 0 to 1. This because DOSBBSECTOR was always
used in conjunction with an addition of 1. The PC98_BBSECTOR symbol
is defined as 1 and the expression is simplified.
Note: it is not believed that ports are seriously impacted; or at
all for that matter.
Approved by: nyan@
Diffstat (limited to 'sbin/fdisk_pc98/fdisk.c')
-rw-r--r-- | sbin/fdisk_pc98/fdisk.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sbin/fdisk_pc98/fdisk.c b/sbin/fdisk_pc98/fdisk.c index b66bad4..479e1e4 100644 --- a/sbin/fdisk_pc98/fdisk.c +++ b/sbin/fdisk_pc98/fdisk.c @@ -254,7 +254,7 @@ main(int argc, char *argv[]) dos_sectors); printf("Part %11s %11s %4s %4s %-16s\n", "Start", "Size", "MID", "SID", "Name"); - for (i = 0; i < NDOSPART; i++) { + for (i = 0; i < PC98_NPARTS; i++) { partp = ((struct pc98_partition *) &mboot.parts) + i; if (partp->dp_sid == 0) continue; @@ -310,7 +310,7 @@ main(int argc, char *argv[]) printf("Warning: BIOS sector numbering starts with sector 1\n"); printf("Information from DOS bootblock is:\n"); if (partition == -1) - for (i = 1; i <= NDOSPART; i++) + for (i = 1; i <= PC98_NPARTS; i++) change_part(i, v_flag); else change_part(partition, 1); @@ -367,7 +367,7 @@ print_s0(int which) print_params(); printf("Information from DOS bootblock is:\n"); if (which == -1) { - for (i = 1; i <= NDOSPART; i++) + for (i = 1; i <= PC98_NPARTS; i++) if (v_flag || !part_unused(i)) { printf("%d: ", i); print_part(i); @@ -414,7 +414,7 @@ static void init_boot(void) { - mboot.signature = DOSMAGIC; + mboot.signature = PC98_MAGIC; } @@ -517,7 +517,7 @@ change_active(int which) int active, i, new, tmp; active = -1; - for (i = 0; i < NDOSPART; i++) { + for (i = 0; i < PC98_NPARTS; i++) { if ((partp[i].dp_sid & PC98_SID_ACTIVE) == 0) continue; printf("Partition %d is marked active\n", i + 1); @@ -672,7 +672,7 @@ write_disk(off_t sector, void *buf) if (error == sz) return (0); - for (i = 0; i < NDOSPART; i++) { + for (i = 0; i < PC98_NPARTS; i++) { sprintf(fbuf, "%ss%d", disk, i + 1); fdw = open(fbuf, O_RDWR, 0); if (fdw < 0) @@ -731,7 +731,7 @@ read_s0() warnx("can't read fdisk partition table"); return -1; } - if (mboot.signature != DOSMAGIC) { + if (mboot.signature != PC98_MAGIC) { warnx("invalid fdisk partition table found"); /* So should we initialize things */ return -1; @@ -911,7 +911,7 @@ reset_boot(void) struct pc98_partition *partp; init_boot(); - for (i = 1; i <= NDOSPART; i++) { + for (i = 1; i <= PC98_NPARTS; i++) { partp = ((struct pc98_partition *) &mboot.parts) + i - 1; bzero((char *)partp, sizeof (struct pc98_partition)); } |