diff options
author | jkh <jkh@FreeBSD.org> | 1997-01-17 08:47:13 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1997-01-17 08:47:13 +0000 |
commit | 01b3e9a58be60d613a1575a5cd4341ab143f4ad3 (patch) | |
tree | 1d6cafcedb59c96ea3e9343e95b8c4dc482c6a3b /usr.sbin/sysinstall/ftp.c | |
parent | 83c2f5687e154ea6600cc012b5003a582b4f0dee (diff) | |
download | FreeBSD-src-01b3e9a58be60d613a1575a5cd4341ab143f4ad3.zip FreeBSD-src-01b3e9a58be60d613a1575a5cd4341ab143f4ad3.tar.gz |
Now that I know which parts of the installation really need it (since
there's no menu display bug to work around now), be far more selective
in my use of DITEM_RECREATE (which is slow and involves much screen I/O).
Diffstat (limited to 'usr.sbin/sysinstall/ftp.c')
-rw-r--r-- | usr.sbin/sysinstall/ftp.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/usr.sbin/sysinstall/ftp.c b/usr.sbin/sysinstall/ftp.c index 1c5a6e6..07c4528 100644 --- a/usr.sbin/sysinstall/ftp.c +++ b/usr.sbin/sysinstall/ftp.c @@ -73,15 +73,20 @@ mediaInitFTP(Device *dev) try: cp = variable_get(VAR_FTP_PATH); if (!cp) { - if (DITEM_STATUS(mediaSetFTP(NULL)) == DITEM_FAILURE || (cp = variable_get(VAR_FTP_PATH)) == NULL) - return FALSE; + if (DITEM_STATUS(mediaSetFTP(NULL)) == DITEM_FAILURE || (cp = variable_get(VAR_FTP_PATH)) == NULL) { + msgConfirm("Unable to get proper FTP path. FTP media not initialized."); + netdev->shutdown(netdev); + return FALSE; + } } hostname = variable_get(VAR_FTP_HOST); dir = variable_get(VAR_FTP_DIR); - if (!hostname || !dir) - msgFatal("Missing FTP host or directory specification - something's wrong!"); - + if (!hostname || !dir) { + msgConfirm("Missing FTP host or directory specification. FTP media not initialized,"); + netdev->shutdown(netdev); + return FALSE; + } user = variable_get(VAR_FTP_USER); login_name = (!user || !*user) ? "anonymous" : user; @@ -91,10 +96,7 @@ try: sprintf(password, "installer@%s", variable_get(VAR_HOSTNAME)); msgNotify("Logging in to %s@%s..", login_name, hostname); if ((OpenConn = ftpLogin(hostname, login_name, password, FtpPort, isDebug(), &code)) == NULL) { - if (variable_get(VAR_NO_CONFIRM)) - msgNotify("Couldn't open FTP connection to %s, errcode = %d", hostname, code); - else - msgConfirm("Couldn't open FTP connection to %s, errcode = %d", hostname, code); + msgConfirm("Couldn't open FTP connection to %s, errcode = %d", hostname, code); goto punt; } @@ -145,6 +147,7 @@ punt: fclose(OpenConn); OpenConn = NULL; } + netdev->shutdown(netdev); variable_unset(VAR_FTP_PATH); return FALSE; } @@ -215,8 +218,7 @@ mediaShutdownFTP(Device *dev) if (!ftpInitted) return; - if (isDebug()) - msgDebug("FTP shutdown called. OpenConn = %x\n", OpenConn); + msgDebug("FTP shutdown called. OpenConn = %x\n", OpenConn); if (OpenConn != NULL) { fclose(OpenConn); OpenConn = NULL; |