From: Michael Tremer Date: Sun, 12 Oct 2014 13:04:25 +0000 (+0200) Subject: installer: Remove reading the path of the downloaded ISO X-Git-Tag: v2.17-core87~103^2~51^2~2 X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=commitdiff_plain;h=b84813b4327d781611ebb5e02ebb1bb07aaed9a2 installer: Remove reading the path of the downloaded ISO --- diff --git a/src/installer/main.c b/src/installer/main.c index 520ae3a8b1..411121c125 100644 --- a/src/installer/main.c +++ b/src/installer/main.c @@ -25,6 +25,7 @@ #define INST_FILECOUNT 21000 #define UNATTENDED_CONF "/cdrom/boot/unattended.conf" #define LICENSE_FILE "/cdrom/COPYING" +#define SOURCE_TEMPFILE "/tmp/downloaded-image.iso" extern char url[STRING_SIZE]; @@ -381,16 +382,17 @@ int main(int argc, char *argv[]) { // Download the image if required if (!sourcedrive) { - runcommandwithstatus("/usr/bin/downloadsource.sh", - title, _("Downloading installation image..."), logfile); - - if ((handle = fopen("/tmp/source_device", "r")) == NULL) { - errorbox(_("Download error")); + snprintf(commandstring, sizeof(commandstring), "/usr/bin/downloadsource.sh %s", SOURCE_TEMPFILE); + runcommandwithstatus(commandstring, title, _("Downloading installation image..."), logfile); + + FILE* f = fopen(SOURCE_TEMPFILE, "r"); + if (f) { + sourcedrive = SOURCE_TEMPFILE; + fclose(f); + } else { + errorbox(_("The installation image could not be downloaded.")); goto EXIT; } - - fgets(sourcedrive, 5, handle); - fclose(handle); } }