aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1997-01-16 14:42:21 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1997-01-16 14:42:21 +0000
commit2974f2c0776a3fb5d8482d60a67cf496369ea771 (patch)
tree5a0a76133ec42178999aeaf9f66caac27d2e6f72 /usr.sbin
parentf7b630a4031affb2450a27300385a5bbbecba9cf (diff)
Notes
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/sade/disks.c18
-rw-r--r--usr.sbin/sysinstall/disks.c18
2 files changed, 20 insertions, 16 deletions
diff --git a/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c
index fb66e3a1387f..b4f09009619f 100644
--- a/usr.sbin/sade/disks.c
+++ b/usr.sbin/sade/disks.c
@@ -189,7 +189,8 @@ diskPartition(Device *dev, Disk *d)
char *val, geometry[80];
/* Now print our overall state */
- print_chunks(d);
+ if (d)
+ print_chunks(d);
print_command_summary();
if (msg) {
attrset(title_attr); mvprintw(23, 0, msg); attrset(A_NORMAL);
@@ -357,17 +358,18 @@ diskPartition(Device *dev, Disk *d)
"can't undo it.");
}
else if (!msgYesNo("Are you SURE you want to Undo everything?")) {
- d = Open_Disk(d->name);
- if (!d) {
- msgConfirm("Can't reopen disk %s! Internal state is probably corrupted", d->name);
- clear();
- break;
- }
+ char cp[BUFSIZ];
+
+ sstrncpy(cp, d->name, sizeof cp);
Free_Disk(dev->private);
+ d = Open_Disk(cp);
+ if (!d)
+ msgConfirm("Can't reopen disk %s! Internal state is probably corrupted", cp);
dev->private = d;
variable_unset(DISK_PARTITIONED);
variable_unset(DISK_LABELLED);
- record_chunks(d);
+ if (d)
+ record_chunks(d);
}
clear();
break;
diff --git a/usr.sbin/sysinstall/disks.c b/usr.sbin/sysinstall/disks.c
index fb66e3a1387f..b4f09009619f 100644
--- a/usr.sbin/sysinstall/disks.c
+++ b/usr.sbin/sysinstall/disks.c
@@ -189,7 +189,8 @@ diskPartition(Device *dev, Disk *d)
char *val, geometry[80];
/* Now print our overall state */
- print_chunks(d);
+ if (d)
+ print_chunks(d);
print_command_summary();
if (msg) {
attrset(title_attr); mvprintw(23, 0, msg); attrset(A_NORMAL);
@@ -357,17 +358,18 @@ diskPartition(Device *dev, Disk *d)
"can't undo it.");
}
else if (!msgYesNo("Are you SURE you want to Undo everything?")) {
- d = Open_Disk(d->name);
- if (!d) {
- msgConfirm("Can't reopen disk %s! Internal state is probably corrupted", d->name);
- clear();
- break;
- }
+ char cp[BUFSIZ];
+
+ sstrncpy(cp, d->name, sizeof cp);
Free_Disk(dev->private);
+ d = Open_Disk(cp);
+ if (!d)
+ msgConfirm("Can't reopen disk %s! Internal state is probably corrupted", cp);
dev->private = d;
variable_unset(DISK_PARTITIONED);
variable_unset(DISK_LABELLED);
- record_chunks(d);
+ if (d)
+ record_chunks(d);
}
clear();
break;