From 1c5237db6fef1b4d6401879390de0f3c21a2976c Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Wed, 29 Jan 1997 03:30:24 +0000 Subject: [PATCH] Make media re-init a user choice. --- release/sysinstall/dist.c | 17 +++++++++++------ usr.sbin/sysinstall/dist.c | 17 +++++++++++------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/release/sysinstall/dist.c b/release/sysinstall/dist.c index f1c56b6dd07c..d8767712bfee 100644 --- a/release/sysinstall/dist.c +++ b/release/sysinstall/dist.c @@ -440,15 +440,20 @@ distExtract(char *parent, Distribution *me) continue; } else if (fp == (FILE *)IO_ERROR || intr) { /* Hard error, can't continue */ - msgConfirm("Unable to open %s: %s.\nReinitializing media.", - buf, !intr ? "I/O error." : "User interrupt."); - mediaDevice->shutdown(mediaDevice); - if (!mediaDevice->init(mediaDevice)) { + if (!msgYesNo("Unable to open %s: %s.\nReinitialize media?", + buf, !intr ? "I/O error." : "User interrupt.")) { + mediaDevice->shutdown(mediaDevice); + if (!mediaDevice->init(mediaDevice)) { + status = FALSE; + goto done; + } + else + goto getinfo; + } + else { status = FALSE; goto done; } - else - goto getinfo; } else { /* Try to get the distribution as a single file */ diff --git a/usr.sbin/sysinstall/dist.c b/usr.sbin/sysinstall/dist.c index f1c56b6dd07c..d8767712bfee 100644 --- a/usr.sbin/sysinstall/dist.c +++ b/usr.sbin/sysinstall/dist.c @@ -440,15 +440,20 @@ distExtract(char *parent, Distribution *me) continue; } else if (fp == (FILE *)IO_ERROR || intr) { /* Hard error, can't continue */ - msgConfirm("Unable to open %s: %s.\nReinitializing media.", - buf, !intr ? "I/O error." : "User interrupt."); - mediaDevice->shutdown(mediaDevice); - if (!mediaDevice->init(mediaDevice)) { + if (!msgYesNo("Unable to open %s: %s.\nReinitialize media?", + buf, !intr ? "I/O error." : "User interrupt.")) { + mediaDevice->shutdown(mediaDevice); + if (!mediaDevice->init(mediaDevice)) { + status = FALSE; + goto done; + } + else + goto getinfo; + } + else { status = FALSE; goto done; } - else - goto getinfo; } else { /* Try to get the distribution as a single file */