diff options
-rw-r--r-- | usr.sbin/sade/disks.c | 8 | ||||
-rw-r--r-- | usr.sbin/sysinstall/disks.c | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c index 234c59c..1e35c7b 100644 --- a/usr.sbin/sade/disks.c +++ b/usr.sbin/sade/disks.c @@ -74,7 +74,8 @@ enum size_units_t { UNIT_BLOCKS, UNIT_KILO, UNIT_MEG, UNIT_GIG, UNIT_SIZE }; #define CHUNK_START_ROW 5 /* Where we keep track of MBR chunks */ -static struct chunk *chunk_info[16]; +#define CHUNK_INFO_ENTRIES 16 +static struct chunk *chunk_info[CHUNK_INFO_ENTRIES]; static int current_chunk; static void diskPartitionNonInteractive(Device *dev); @@ -312,6 +313,7 @@ diskPartition(Device *dev) { char *cp, *p; int rv, key = 0; + int i; Boolean chunking; char *msg = NULL; #ifdef PC98 @@ -535,6 +537,10 @@ diskPartition(Device *dev) break; case 'S': + /* Clear active states so we won't have two */ + for (i = 0; (chunk_info[i] != NULL) && (i < CHUNK_INFO_ENTRIES); i++) + chunk_info[i]->flags &= !CHUNK_ACTIVE; + /* Set Bootable */ chunk_info[current_chunk]->flags |= CHUNK_ACTIVE; break; diff --git a/usr.sbin/sysinstall/disks.c b/usr.sbin/sysinstall/disks.c index 234c59c..1e35c7b 100644 --- a/usr.sbin/sysinstall/disks.c +++ b/usr.sbin/sysinstall/disks.c @@ -74,7 +74,8 @@ enum size_units_t { UNIT_BLOCKS, UNIT_KILO, UNIT_MEG, UNIT_GIG, UNIT_SIZE }; #define CHUNK_START_ROW 5 /* Where we keep track of MBR chunks */ -static struct chunk *chunk_info[16]; +#define CHUNK_INFO_ENTRIES 16 +static struct chunk *chunk_info[CHUNK_INFO_ENTRIES]; static int current_chunk; static void diskPartitionNonInteractive(Device *dev); @@ -312,6 +313,7 @@ diskPartition(Device *dev) { char *cp, *p; int rv, key = 0; + int i; Boolean chunking; char *msg = NULL; #ifdef PC98 @@ -535,6 +537,10 @@ diskPartition(Device *dev) break; case 'S': + /* Clear active states so we won't have two */ + for (i = 0; (chunk_info[i] != NULL) && (i < CHUNK_INFO_ENTRIES); i++) + chunk_info[i]->flags &= !CHUNK_ACTIVE; + /* Set Bootable */ chunk_info[current_chunk]->flags |= CHUNK_ACTIVE; break; |