diff options
author | Peter Jones <pjones@redhat.com> | 2008-10-23 12:05:25 -0400 |
---|---|---|
committer | Peter Jones <pjones@pjones2.localdomain> | 2008-10-23 13:06:01 -0400 |
commit | 436bd62edb35525dd1d149ee1c5ad72b687cbbae (patch) | |
tree | b036192444c4d5b1cfe50a828138a8e1efbf7532 /loader | |
parent | b8d2b88a405ec277dbfb75bc6f6f074769fa6757 (diff) | |
download | anaconda-436bd62edb35525dd1d149ee1c5ad72b687cbbae.tar.gz anaconda-436bd62edb35525dd1d149ee1c5ad72b687cbbae.tar.xz anaconda-436bd62edb35525dd1d149ee1c5ad72b687cbbae.zip |
Fix "looking for installation images" when there's no disc at all.
Don't check for ENOMEDIUM on opening the device right after we got a
real drive status from it. Instead, just consider the actual drive
status from waitForCdromTrayClose().
Diffstat (limited to 'loader')
-rw-r--r-- | loader/cdinstall.c | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/loader/cdinstall.c b/loader/cdinstall.c index 0b03a6dfa..f3c55b8fa 100644 --- a/loader/cdinstall.c +++ b/loader/cdinstall.c @@ -307,7 +307,6 @@ static char *setupCdrom(char *location, struct loaderData_s *loaderData, do { for (i = 0; devices[i]; i++) { char *tmp = NULL; - int j; int fd; if (!devices[i]->device) @@ -332,23 +331,29 @@ static char *setupCdrom(char *location, struct loaderData_s *loaderData, printf(_("Looking for installation images on CD device %s"), devices[i]->device); fd = open(devices[i]->device, O_RDONLY | O_NONBLOCK); - if (fd >= 0) { - waitForCdromTrayClose(fd); - close(fd); - } - - for (j = 0; j < 450; j++) { - fd = open(devices[i]->device, O_RDONLY); - if (fd >= 0) { - close(fd); - break; - } else if (errno == ENOMEDIUM) { - logMessage(DEBUGLVL, "%s reported %m", devices[i]->device); - usleep(100000); - } else { - break; - } - } + if (fd < 0) { + logMessage(ERROR, "Couldn't open %s: %m", devices[i]->device); + if (!FL_CMDLINE(flags)) + newtPopWindow(); + continue; + } + + rc = waitForCdromTrayClose(fd); + close(fd); + switch (rc) { + case CDS_NO_INFO: + logMessage(ERROR, "Drive tray reports CDS_NO_INFO"); + break; + case CDS_NO_DISC: + if (!FL_CMDLINE(flags)) + newtPopWindow(); + continue; + case CDS_TRAY_OPEN: + logMessage(ERROR, "Drive tray reports open when it should be closed"); + break; + default: + break; + } if (!FL_CMDLINE(flags)) newtPopWindow(); |