From 3443796a040f6ad790564bd17802aef17cf22842 Mon Sep 17 00:00:00 2001 From: dcs Date: Thu, 17 Feb 2000 17:57:40 +0000 Subject: If the installation media disappears in the process of installing a distribution, recognize it and treat as fatal media error. This happens in the case of a timeout on FTP installations where the user chooses not to select another FTP site, and resulted in segmentation fault. Approved by: jkh --- usr.sbin/sysinstall/dist.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/sysinstall/dist.c b/usr.sbin/sysinstall/dist.c index 5ada8b7..f54a2de 100644 --- a/usr.sbin/sysinstall/dist.c +++ b/usr.sbin/sysinstall/dist.c @@ -630,7 +630,8 @@ distExtract(char *parent, Distribution *me) getinfo: fp = mediaDevice->get(mediaDevice, buf, TRUE); intr = check_for_interrupt(); - if (fp == (FILE *)IO_ERROR || intr) { /* Hard error, can't continue */ + if (fp == (FILE *)IO_ERROR || intr || !mediaDevice) { + /* Hard error, can't continue */ if (!msgYesNo("Unable to open %s: %s.\nReinitialize media?", buf, !intr ? "I/O error." : "User interrupt.")) { mediaDevice->shutdown(mediaDevice); @@ -676,7 +677,8 @@ distExtract(char *parent, Distribution *me) getsingle: fp = mediaDevice->get(mediaDevice, buf, TRUE); intr = check_for_interrupt(); - if (fp == (FILE *)IO_ERROR || intr) { /* Hard error, can't continue */ + if (fp == (FILE *)IO_ERROR || intr || !mediaDevice) { + /* Hard error, can't continue */ if (intr) /* result of an interrupt */ msgConfirm("Unable to open %s: User interrupt", buf); else -- cgit v1.1