Change the logic for how error messages are printed so we can actually
see them.
This commit is contained in:
parent
21bd442d86
commit
15196a0bab
@ -431,6 +431,12 @@ DiskLabel()
|
|||||||
sec = lbl->d_nsectors;
|
sec = lbl->d_nsectors;
|
||||||
tsec = lbl->d_secperunit;
|
tsec = lbl->d_secperunit;
|
||||||
while(!done) {
|
while(!done) {
|
||||||
|
char *yip = NULL;
|
||||||
|
|
||||||
|
if (yip) {
|
||||||
|
yelp(yip);
|
||||||
|
yip = NULL;
|
||||||
|
}
|
||||||
clear(); standend();
|
clear(); standend();
|
||||||
j = 0;
|
j = 0;
|
||||||
mvprintw(j++, 0, "%s -- Diskspace editor -- DISKLABEL", TITLE);
|
mvprintw(j++, 0, "%s -- Diskspace editor -- DISKLABEL", TITLE);
|
||||||
@ -485,7 +491,7 @@ DiskLabel()
|
|||||||
case 'd': case 'D':
|
case 'd': case 'D':
|
||||||
j = AskWhichPartition("Delete which partition? ");
|
j = AskWhichPartition("Delete which partition? ");
|
||||||
if (j < 0) {
|
if (j < 0) {
|
||||||
yelp("Invalid partition");
|
yip = "Invalid partition";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
CleanMount(diskno, j);
|
CleanMount(diskno, j);
|
||||||
@ -497,17 +503,17 @@ DiskLabel()
|
|||||||
case 's': case 'S':
|
case 's': case 'S':
|
||||||
j = AskWhichPartition("Change size of which partition? ");
|
j = AskWhichPartition("Change size of which partition? ");
|
||||||
if (j < 0) {
|
if (j < 0) {
|
||||||
yelp("Invalid partition");
|
yip = "Invalid partition";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (lbl->d_partitions[j].p_fstype != FS_BSDFFS &&
|
if (lbl->d_partitions[j].p_fstype != FS_BSDFFS &&
|
||||||
lbl->d_partitions[j].p_fstype != FS_UNUSED &&
|
lbl->d_partitions[j].p_fstype != FS_UNUSED &&
|
||||||
lbl->d_partitions[j].p_fstype != FS_SWAP) {
|
lbl->d_partitions[j].p_fstype != FS_SWAP) {
|
||||||
yelp("Invalid partition type");
|
yip = "Invalid partition type";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (lbl->d_partitions[OURPART].p_size == 0) {
|
if (lbl->d_partitions[OURPART].p_size == 0) {
|
||||||
yelp("No FreeBSD partition defined?");
|
yip = "No FreeBSD partition defined?";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
l1=lbl->d_partitions[OURPART].p_offset;
|
l1=lbl->d_partitions[OURPART].p_offset;
|
||||||
@ -532,14 +538,14 @@ DiskLabel()
|
|||||||
l2 = l1;
|
l2 = l1;
|
||||||
}
|
}
|
||||||
if (!(l2 - l1)) {
|
if (!(l2 - l1)) {
|
||||||
yelp("Oh god, I'm so confused!");
|
yip = "Oh god, I'm so confused!";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sprintf(buf, "%lu", (l2-l1+1024L)/2048L);
|
sprintf(buf, "%lu", (l2-l1+1024L)/2048L);
|
||||||
i = AskEm(stdscr, "Size of partition in MB> ", buf, 10);
|
i = AskEm(stdscr, "Size of partition in MB> ", buf, 10);
|
||||||
l3= strtol(buf, 0, 0) * 2048L;
|
l3= strtol(buf, 0, 0) * 2048L;
|
||||||
if (!l3) {
|
if (!l3) {
|
||||||
yelp("Invalid size given");
|
yip = "Invalid size given";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (l3 > l2 - l1)
|
if (l3 > l2 - l1)
|
||||||
@ -562,16 +568,16 @@ DiskLabel()
|
|||||||
case 'm': case 'M':
|
case 'm': case 'M':
|
||||||
j = AskWhichPartition("Mountpoint of which partition ? ");
|
j = AskWhichPartition("Mountpoint of which partition ? ");
|
||||||
if (j < 0) {
|
if (j < 0) {
|
||||||
yelp("Invalid partition");
|
yip = "Invalid partition";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
k = lbl->d_partitions[j].p_fstype;
|
k = lbl->d_partitions[j].p_fstype;
|
||||||
if (k != FS_BSDFFS && k != FS_MSDOS && k != FS_SWAP) {
|
if (k != FS_BSDFFS && k != FS_MSDOS && k != FS_SWAP) {
|
||||||
yelp("Invalid partition type");
|
yip = "Invalid partition type";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!lbl->d_partitions[j].p_size) {
|
if (!lbl->d_partitions[j].p_size) {
|
||||||
yelp("Zero partition size");
|
yip = "Zero partition size";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (k == FS_SWAP)
|
if (k == FS_SWAP)
|
||||||
@ -583,14 +589,13 @@ DiskLabel()
|
|||||||
if (k != FS_SWAP) {
|
if (k != FS_SWAP) {
|
||||||
i = AskEm(stdscr, "Mount on directory> ", buf, 28);
|
i = AskEm(stdscr, "Mount on directory> ", buf, 28);
|
||||||
if (i != '\n' && i != '\r') {
|
if (i != '\n' && i != '\r') {
|
||||||
yelp("Invalid directory name");
|
yip ="Invalid directory name";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CleanMount(diskno, j);
|
CleanMount(diskno, j);
|
||||||
p = SetMount(diskno,j,buf);
|
p = SetMount(diskno,j,buf);
|
||||||
if(p)
|
yip = p;
|
||||||
yelp(p);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'w': case 'W':
|
case 'w': case 'W':
|
||||||
|
Loading…
Reference in New Issue
Block a user