summaryrefslogtreecommitdiffstats
path: root/loader
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2001-06-29 20:18:59 +0000
committerErik Troan <ewt@redhat.com>2001-06-29 20:18:59 +0000
commitfc303be29307115ddbf8e1bf833553b916d1e7eb (patch)
tree6e8f6127297a7886dbc9cbf8665ad200118f1132 /loader
parent9be120136dcdc264225e30ebd449d83403addd16 (diff)
downloadanaconda-fc303be29307115ddbf8e1bf833553b916d1e7eb.tar.gz
anaconda-fc303be29307115ddbf8e1bf833553b916d1e7eb.tar.xz
anaconda-fc303be29307115ddbf8e1bf833553b916d1e7eb.zip
optionally ignore error messages
Diffstat (limited to 'loader')
-rw-r--r--loader/urls.c19
-rw-r--r--loader/urls.h3
2 files changed, 13 insertions, 9 deletions
diff --git a/loader/urls.c b/loader/urls.c
index 6201ad31f..d3a92f804 100644
--- a/loader/urls.c
+++ b/loader/urls.c
@@ -52,7 +52,8 @@ static const char * urlfilter(const char * u)
}
#endif
-int urlinstStartTransfer(struct iurlinfo * ui, char * filename) {
+int urlinstStartTransfer(struct iurlinfo * ui, char * filename,
+ int silentErrors) {
char * buf;
int fd;
char * finalPrefix;
@@ -62,12 +63,12 @@ int urlinstStartTransfer(struct iurlinfo * ui, char * filename) {
else
finalPrefix = ui->prefix;
- logMessage("transferring %s://%s/%s/RedHat/%s to a fd",
+ logMessage("transferring %s://%s/%s/%s to a fd",
ui->protocol == URL_METHOD_FTP ? "ftp" : "http",
ui->address, finalPrefix, filename);
buf = alloca(strlen(finalPrefix) + strlen(filename) + 20);
- sprintf(buf, "%s/RedHat/%s", finalPrefix, filename);
+ sprintf(buf, "%s/%s", finalPrefix, filename);
if (ui->protocol == URL_METHOD_FTP) {
ui->ftpPort = ftpOpen(ui->address,
@@ -78,21 +79,23 @@ int urlinstStartTransfer(struct iurlinfo * ui, char * filename) {
newtWinMessage(_("Error"), _("Ok"),
_("Failed to log into %s: %s"), ui->address,
ftpStrerror(ui->ftpPort));
- return -1;
+ return -2;
}
fd = ftpGetFileDesc(ui->ftpPort, buf);
if (fd < 0) {
close(ui->ftpPort);
- newtWinMessage(_("Error"), _("Ok"),
- _("Failed to retrieve %s: %s"), buf, ftpStrerror(fd));
+ if (!silentErrors)
+ newtWinMessage(_("Error"), _("Ok"),
+ _("Failed to retrieve %s: %s"), buf, ftpStrerror(fd));
return -1;
}
} else {
fd = httpGetFileDesc(ui->address, -1, buf);
if (fd < 0) {
- newtWinMessage(_("Error"), _("Ok"),
- _("Failed to retrieve %s: %s"), buf, ftpStrerror(fd));
+ if (!silentErrors)
+ newtWinMessage(_("Error"), _("Ok"),
+ _("Failed to retrieve %s: %s"), buf, ftpStrerror(fd));
return -1;
}
}
diff --git a/loader/urls.h b/loader/urls.h
index 321298b37..82e8c4457 100644
--- a/loader/urls.h
+++ b/loader/urls.h
@@ -18,7 +18,8 @@ struct iurlinfo {
int urlMainSetupPanel(struct iurlinfo * ui, urlprotocol protocol,
char * doSecondarySetup);
int urlSecondarySetupPanel(struct iurlinfo * ui, urlprotocol protocol);
-int urlinstStartTransfer(struct iurlinfo * ui, char * filename);
+int urlinstStartTransfer(struct iurlinfo * ui, char * filename,
+ int silentErrors);
int urlinstFinishTransfer(struct iurlinfo * ui, int fd);
#endif