DTRT if ESC is hit in a Yes/No dialog.

Noticed-by: jfieber
This commit is contained in:
Jordan K. Hubbard 1996-10-09 09:53:41 +00:00
parent b72acdbdc5
commit b11806da8c
18 changed files with 48 additions and 42 deletions

View File

@ -14,7 +14,7 @@ SRCS= anonFTP.c apache.c attr.c cdrom.c command.c config.c devices.c \
uc_scsi.c
CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog -I${.OBJDIR} -I/sys
CFLAGS+= -DUC_PRIVATE -DKERN_NO_SYMBOLS # -DSAVE_USERCONFIG
CFLAGS+= -DUC_PRIVATE -DKERN_NO_SYMBOLS #-DSAVE_USERCONFIG
#CFLAGS+= -DLOAD_CONFIG_FILE=\"install.cfg\"

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
* $Id: cdrom.c,v 1.22 1996/08/23 07:55:57 jkh Exp $
* $Id: cdrom.c,v 1.23 1996/10/01 12:13:08 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -91,7 +91,7 @@ mediaInitCDROM(Device *dev)
if (!file_readable("/cdrom/cdrom.inf")) {
if (msgYesNo("Warning: The CD currently in the drive is either not a FreeBSD\n"
"CD or it is an older (pre 2.1.5) FreeBSD CD which does not\n"
"have a version number on it. Do you wish to use this CD anyway?")) {
"have a version number on it. Do you wish to use this CD anyway?") != 0) {
unmount("/cdrom", MNT_FORCE);
return FALSE;
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: disks.c,v 1.68 1996/10/04 14:53:48 jkh Exp $
* $Id: disks.c,v 1.69 1996/10/06 11:40:30 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -245,7 +245,7 @@ diskPartition(Device *dev, Disk *d)
rv = msgYesNo("Do you want to do this with a true partition entry\n"
"so as to remain cooperative with any future possible\n"
"operating systems on the drive(s)?");
if (rv) {
if (rv != 0) {
rv = !msgYesNo("This is dangerous in that it will make the drive totally\n"
"uncooperative with other potential operating systems on the\n"
"same disk. It will lead instead to a totally dedicated disk,\n"
@ -259,6 +259,8 @@ diskPartition(Device *dev, Disk *d)
"less at risk.\n\n"
"Do you insist on dedicating the entire disk this way?");
}
if (rv == -1)
rv = 0;
All_FreeBSD(d, rv);
if (rv)
d->bios_hd = d->bios_sect = d->bios_cyl = 1;

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
* $Id: floppy.c,v 1.14 1996/07/08 08:54:25 jkh Exp $
* $Id: floppy.c,v 1.15 1996/09/15 23:55:22 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -106,7 +106,7 @@ getRootFloppy(void)
fd = open(floppyDev->devname, O_RDONLY);
if (isDebug())
msgDebug("getRootFloppy on %s yields fd of %d\n", floppyDev->devname, fd);
if (fd == -1 && msgYesNo("Couldn't open the floppy - do you want to try again?"))
if (fd == -1 && msgYesNo("Couldn't open the floppy - do you want to try again?") != 0)
break;
}
return fd;

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: install.c,v 1.130 1996/10/05 16:33:01 jkh Exp $
* $Id: install.c,v 1.131 1996/10/06 14:45:57 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -210,7 +210,7 @@ installInitial(void)
"If you're running this on a disk with data you wish to save\n"
"then WE STRONGLY ENCOURAGE YOU TO MAKE PROPER BACKUPS before\n"
"proceeding!\n\n"
"We can take no responsibility for lost disk contents!"))
"We can take no responsibility for lost disk contents!") != 0)
return DITEM_FAILURE | DITEM_RESTORE;
if (DITEM_STATUS(diskLabelCommit(NULL)) != DITEM_SUCCESS) {
@ -266,7 +266,7 @@ installFixitFloppy(dialogMenuItem *self)
msgConfirm("Please insert a writable fixit floppy and press return");
if (mount(MOUNT_UFS, "/mnt2", 0, (caddr_t)&args) != -1)
break;
if (msgYesNo("Unable to mount the fixit floppy - do you want to try again?"))
if (msgYesNo("Unable to mount the fixit floppy - do you want to try again?") != 0)
return DITEM_FAILURE;
}
dialog_clear();

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: installUpgrade.c,v 1.31 1996/08/03 10:11:05 jkh Exp $
* $Id: installUpgrade.c,v 1.32 1996/09/18 18:40:37 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -183,7 +183,7 @@ installUpgrade(dialogMenuItem *self)
dialog_clear_norefresh();
if (msgYesNo("Given all that scary stuff you just read, are you sure you want to\n"
"risk it all and proceed with this upgrade?"))
"risk it all and proceed with this upgrade?") != 0)
return DITEM_FAILURE | DITEM_RESTORE;
if (!Dists) {
@ -202,7 +202,7 @@ installUpgrade(dialogMenuItem *self)
if (msgYesNo("You didn't select the bin distribution as one of the distributons to load.\n"
"This one is pretty vital to a successful 2.1 upgrade. Are you SURE you don't\n"
"want to select the bin distribution? Chose _No_ to bring up the Distributions\n"
"menu.")) {
"menu.") != 0) {
if (!dmenuOpenSimple(&MenuDistributions, FALSE))
return DITEM_FAILURE | DITEM_RECREATE;
dialog_clear_norefresh();
@ -282,7 +282,7 @@ installUpgrade(dialogMenuItem *self)
saved_etc = NULL;
if (msgYesNo("Directory was not specified, was invalid or user selected Cancel.\n\n"
"Doing an upgrade without first backing up your /etc directory is a very\n"
"bad idea! Do you want to go back and specify the save directory again?"))
"bad idea! Do you want to go back and specify the save directory again?") != 0)
break;
}
}
@ -291,7 +291,7 @@ installUpgrade(dialogMenuItem *self)
msgNotify("Preserving /etc directory..");
if (vsystem("tar -cf - -C /etc . | tar -xpf - -C %s", saved_etc))
if (msgYesNo("Unable to backup your /etc into %s.\n"
"Do you want to continue anyway?"))
"Do you want to continue anyway?") != 0)
return DITEM_FAILURE | DITEM_RECREATE;
}
if (file_readable("/kernel")) {

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
* $Id: media.c,v 1.58 1996/10/02 08:25:11 jkh Exp $
* $Id: media.c,v 1.59 1996/10/06 02:10:54 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -297,7 +297,7 @@ mediaSetFTP(dialogMenuItem *self)
dialog_clear_norefresh();
if (network_init || msgYesNo("You've already done the network configuration once,\n"
"would you like to skip over it now?")) {
"would you like to skip over it now?") != 0) {
if (!tcpDeviceSelect()) {
variable_unset(VAR_FTP_PATH);
return DITEM_FAILURE | what;

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: samba.c,v 1.7 1996/07/26 08:39:06 jkh Exp $
* $Id: samba.c,v 1.8 1996/08/03 10:11:46 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard & Coranth Gryphon. All rights reserved.
@ -131,7 +131,7 @@ configSamba(dialogMenuItem *self)
tptr = msgGetInput(NULL, "Enter a short description of this share?");
if (tptr && *tptr)
fprintf(fptr, "comment = %s\n", tptr);
if (msgYesNo("Do you want this share to be read only?"))
if (msgYesNo("Do you want this share to be read only?") != 0)
fprintf(fptr, "read only = no\n\n");
else
fprintf(fptr, "read only = yes\n\n");

View File

@ -14,7 +14,7 @@ SRCS= anonFTP.c apache.c attr.c cdrom.c command.c config.c devices.c \
uc_scsi.c
CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog -I${.OBJDIR} -I/sys
CFLAGS+= -DUC_PRIVATE -DKERN_NO_SYMBOLS # -DSAVE_USERCONFIG
CFLAGS+= -DUC_PRIVATE -DKERN_NO_SYMBOLS #-DSAVE_USERCONFIG
#CFLAGS+= -DLOAD_CONFIG_FILE=\"install.cfg\"

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: disks.c,v 1.68 1996/10/04 14:53:48 jkh Exp $
* $Id: disks.c,v 1.69 1996/10/06 11:40:30 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -245,7 +245,7 @@ diskPartition(Device *dev, Disk *d)
rv = msgYesNo("Do you want to do this with a true partition entry\n"
"so as to remain cooperative with any future possible\n"
"operating systems on the drive(s)?");
if (rv) {
if (rv != 0) {
rv = !msgYesNo("This is dangerous in that it will make the drive totally\n"
"uncooperative with other potential operating systems on the\n"
"same disk. It will lead instead to a totally dedicated disk,\n"
@ -259,6 +259,8 @@ diskPartition(Device *dev, Disk *d)
"less at risk.\n\n"
"Do you insist on dedicating the entire disk this way?");
}
if (rv == -1)
rv = 0;
All_FreeBSD(d, rv);
if (rv)
d->bios_hd = d->bios_sect = d->bios_cyl = 1;

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: install.c,v 1.130 1996/10/05 16:33:01 jkh Exp $
* $Id: install.c,v 1.131 1996/10/06 14:45:57 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -210,7 +210,7 @@ installInitial(void)
"If you're running this on a disk with data you wish to save\n"
"then WE STRONGLY ENCOURAGE YOU TO MAKE PROPER BACKUPS before\n"
"proceeding!\n\n"
"We can take no responsibility for lost disk contents!"))
"We can take no responsibility for lost disk contents!") != 0)
return DITEM_FAILURE | DITEM_RESTORE;
if (DITEM_STATUS(diskLabelCommit(NULL)) != DITEM_SUCCESS) {
@ -266,7 +266,7 @@ installFixitFloppy(dialogMenuItem *self)
msgConfirm("Please insert a writable fixit floppy and press return");
if (mount(MOUNT_UFS, "/mnt2", 0, (caddr_t)&args) != -1)
break;
if (msgYesNo("Unable to mount the fixit floppy - do you want to try again?"))
if (msgYesNo("Unable to mount the fixit floppy - do you want to try again?") != 0)
return DITEM_FAILURE;
}
dialog_clear();

View File

@ -14,7 +14,7 @@ SRCS= anonFTP.c apache.c attr.c cdrom.c command.c config.c devices.c \
uc_scsi.c
CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog -I${.OBJDIR} -I/sys
CFLAGS+= -DUC_PRIVATE -DKERN_NO_SYMBOLS # -DSAVE_USERCONFIG
CFLAGS+= -DUC_PRIVATE -DKERN_NO_SYMBOLS #-DSAVE_USERCONFIG
#CFLAGS+= -DLOAD_CONFIG_FILE=\"install.cfg\"

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
* $Id: cdrom.c,v 1.22 1996/08/23 07:55:57 jkh Exp $
* $Id: cdrom.c,v 1.23 1996/10/01 12:13:08 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -91,7 +91,7 @@ mediaInitCDROM(Device *dev)
if (!file_readable("/cdrom/cdrom.inf")) {
if (msgYesNo("Warning: The CD currently in the drive is either not a FreeBSD\n"
"CD or it is an older (pre 2.1.5) FreeBSD CD which does not\n"
"have a version number on it. Do you wish to use this CD anyway?")) {
"have a version number on it. Do you wish to use this CD anyway?") != 0) {
unmount("/cdrom", MNT_FORCE);
return FALSE;
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: disks.c,v 1.68 1996/10/04 14:53:48 jkh Exp $
* $Id: disks.c,v 1.69 1996/10/06 11:40:30 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -245,7 +245,7 @@ diskPartition(Device *dev, Disk *d)
rv = msgYesNo("Do you want to do this with a true partition entry\n"
"so as to remain cooperative with any future possible\n"
"operating systems on the drive(s)?");
if (rv) {
if (rv != 0) {
rv = !msgYesNo("This is dangerous in that it will make the drive totally\n"
"uncooperative with other potential operating systems on the\n"
"same disk. It will lead instead to a totally dedicated disk,\n"
@ -259,6 +259,8 @@ diskPartition(Device *dev, Disk *d)
"less at risk.\n\n"
"Do you insist on dedicating the entire disk this way?");
}
if (rv == -1)
rv = 0;
All_FreeBSD(d, rv);
if (rv)
d->bios_hd = d->bios_sect = d->bios_cyl = 1;

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
* $Id: floppy.c,v 1.14 1996/07/08 08:54:25 jkh Exp $
* $Id: floppy.c,v 1.15 1996/09/15 23:55:22 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -106,7 +106,7 @@ getRootFloppy(void)
fd = open(floppyDev->devname, O_RDONLY);
if (isDebug())
msgDebug("getRootFloppy on %s yields fd of %d\n", floppyDev->devname, fd);
if (fd == -1 && msgYesNo("Couldn't open the floppy - do you want to try again?"))
if (fd == -1 && msgYesNo("Couldn't open the floppy - do you want to try again?") != 0)
break;
}
return fd;

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: install.c,v 1.130 1996/10/05 16:33:01 jkh Exp $
* $Id: install.c,v 1.131 1996/10/06 14:45:57 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -210,7 +210,7 @@ installInitial(void)
"If you're running this on a disk with data you wish to save\n"
"then WE STRONGLY ENCOURAGE YOU TO MAKE PROPER BACKUPS before\n"
"proceeding!\n\n"
"We can take no responsibility for lost disk contents!"))
"We can take no responsibility for lost disk contents!") != 0)
return DITEM_FAILURE | DITEM_RESTORE;
if (DITEM_STATUS(diskLabelCommit(NULL)) != DITEM_SUCCESS) {
@ -266,7 +266,7 @@ installFixitFloppy(dialogMenuItem *self)
msgConfirm("Please insert a writable fixit floppy and press return");
if (mount(MOUNT_UFS, "/mnt2", 0, (caddr_t)&args) != -1)
break;
if (msgYesNo("Unable to mount the fixit floppy - do you want to try again?"))
if (msgYesNo("Unable to mount the fixit floppy - do you want to try again?") != 0)
return DITEM_FAILURE;
}
dialog_clear();

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: installUpgrade.c,v 1.31 1996/08/03 10:11:05 jkh Exp $
* $Id: installUpgrade.c,v 1.32 1996/09/18 18:40:37 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -183,7 +183,7 @@ installUpgrade(dialogMenuItem *self)
dialog_clear_norefresh();
if (msgYesNo("Given all that scary stuff you just read, are you sure you want to\n"
"risk it all and proceed with this upgrade?"))
"risk it all and proceed with this upgrade?") != 0)
return DITEM_FAILURE | DITEM_RESTORE;
if (!Dists) {
@ -202,7 +202,7 @@ installUpgrade(dialogMenuItem *self)
if (msgYesNo("You didn't select the bin distribution as one of the distributons to load.\n"
"This one is pretty vital to a successful 2.1 upgrade. Are you SURE you don't\n"
"want to select the bin distribution? Chose _No_ to bring up the Distributions\n"
"menu.")) {
"menu.") != 0) {
if (!dmenuOpenSimple(&MenuDistributions, FALSE))
return DITEM_FAILURE | DITEM_RECREATE;
dialog_clear_norefresh();
@ -282,7 +282,7 @@ installUpgrade(dialogMenuItem *self)
saved_etc = NULL;
if (msgYesNo("Directory was not specified, was invalid or user selected Cancel.\n\n"
"Doing an upgrade without first backing up your /etc directory is a very\n"
"bad idea! Do you want to go back and specify the save directory again?"))
"bad idea! Do you want to go back and specify the save directory again?") != 0)
break;
}
}
@ -291,7 +291,7 @@ installUpgrade(dialogMenuItem *self)
msgNotify("Preserving /etc directory..");
if (vsystem("tar -cf - -C /etc . | tar -xpf - -C %s", saved_etc))
if (msgYesNo("Unable to backup your /etc into %s.\n"
"Do you want to continue anyway?"))
"Do you want to continue anyway?") != 0)
return DITEM_FAILURE | DITEM_RECREATE;
}
if (file_readable("/kernel")) {

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
* $Id: media.c,v 1.58 1996/10/02 08:25:11 jkh Exp $
* $Id: media.c,v 1.59 1996/10/06 02:10:54 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -297,7 +297,7 @@ mediaSetFTP(dialogMenuItem *self)
dialog_clear_norefresh();
if (network_init || msgYesNo("You've already done the network configuration once,\n"
"would you like to skip over it now?")) {
"would you like to skip over it now?") != 0) {
if (!tcpDeviceSelect()) {
variable_unset(VAR_FTP_PATH);
return DITEM_FAILURE | what;