From c6934947db3197575fa426d0a5e699ddfdd787f6 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Mon, 30 Jul 2001 20:45:54 +0000 Subject: [PATCH] If we're set to non-interactive, we shouldn't ask the user yes/no questions but simply return the default answer instead. --- usr.sbin/sade/msg.c | 4 ++++ usr.sbin/sysinstall/media.c | 6 ++---- usr.sbin/sysinstall/msg.c | 4 ++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/usr.sbin/sade/msg.c b/usr.sbin/sade/msg.c index 256346eb6ba..d54c65268ab 100644 --- a/usr.sbin/sade/msg.c +++ b/usr.sbin/sade/msg.c @@ -237,6 +237,8 @@ msgYesNo(char *fmt, ...) ioctl(0, VT_ACTIVATE, 1); /* Switch back */ msgInfo(NULL); } + if (variable_get(VAR_NONINTERACTIVE)) + return 1; /* If non-interactive, return YES all the time */ ret = dialog_yesno("User Confirmation Requested", errstr, -1, -1); restorescr(w); return ret; @@ -261,6 +263,8 @@ msgNoYes(char *fmt, ...) ioctl(0, VT_ACTIVATE, 1); /* Switch back */ msgInfo(NULL); } + if (variable_get(VAR_NONINTERACTIVE)) + return 0; /* If non-interactive, return NO all the time */ ret = dialog_noyes("User Confirmation Requested", errstr, -1, -1); restorescr(w); return ret; diff --git a/usr.sbin/sysinstall/media.c b/usr.sbin/sysinstall/media.c index 789d0a69956..c5216e28c62 100644 --- a/usr.sbin/sysinstall/media.c +++ b/usr.sbin/sysinstall/media.c @@ -323,10 +323,8 @@ mediaSetFTP(dialogMenuItem *self) mediaClose(); cp = variable_get(VAR_FTP_PATH); /* If we've been through here before ... */ - if (!variable_get(VAR_NONINTERACTIVE)) - if (networkDev && cp && msgYesNo("Re-use old FTP site selection values?")) - cp = NULL; - + if (networkDev && cp && msgYesNo("Re-use old FTP site selection values?")) + cp = NULL; if (!cp) { if (!dmenuOpenSimple(&MenuMediaFTP, FALSE)) return DITEM_FAILURE; diff --git a/usr.sbin/sysinstall/msg.c b/usr.sbin/sysinstall/msg.c index 256346eb6ba..d54c65268ab 100644 --- a/usr.sbin/sysinstall/msg.c +++ b/usr.sbin/sysinstall/msg.c @@ -237,6 +237,8 @@ msgYesNo(char *fmt, ...) ioctl(0, VT_ACTIVATE, 1); /* Switch back */ msgInfo(NULL); } + if (variable_get(VAR_NONINTERACTIVE)) + return 1; /* If non-interactive, return YES all the time */ ret = dialog_yesno("User Confirmation Requested", errstr, -1, -1); restorescr(w); return ret; @@ -261,6 +263,8 @@ msgNoYes(char *fmt, ...) ioctl(0, VT_ACTIVATE, 1); /* Switch back */ msgInfo(NULL); } + if (variable_get(VAR_NONINTERACTIVE)) + return 0; /* If non-interactive, return NO all the time */ ret = dialog_noyes("User Confirmation Requested", errstr, -1, -1); restorescr(w); return ret;