diff options
author | jkh <jkh@FreeBSD.org> | 2001-07-30 20:45:54 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 2001-07-30 20:45:54 +0000 |
commit | 0d0a83d135cf658afdb95d054dadc23d596b55be (patch) | |
tree | 49b59cd82d15b3e3e416b5dfe6cf455231c179b1 /usr.sbin | |
parent | 4763bc528ea62c67eec3c4061a9901246e7e9655 (diff) | |
download | FreeBSD-src-0d0a83d135cf658afdb95d054dadc23d596b55be.zip FreeBSD-src-0d0a83d135cf658afdb95d054dadc23d596b55be.tar.gz |
If we're set to non-interactive, we shouldn't ask the user yes/no questions
but simply return the default answer instead.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/sade/msg.c | 4 | ||||
-rw-r--r-- | usr.sbin/sysinstall/media.c | 6 | ||||
-rw-r--r-- | 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 256346e..d54c652 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 789d0a6..c5216e2 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 256346e..d54c652 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; |