On 11/10/2009 11:19 AM, Hans de Goede wrote:
On 11/10/2009 05:56 PM, Ales Kozumplik wrote:
- if (doPwMount("/tmp/srcdev", "/tmp/mnt", "vfat", IMOUNT_RDONLY, NULL)&&
- doPwMount("/tmp/srcdev", "/tmp/mnt", "ext2", IMOUNT_RDONLY, NULL)&&
- doPwMount("/tmp/srcdev", "/tmp/mnt", "iso9660", IMOUNT_RDONLY, NULL)) {
+ /* some USB thumb drives and hard drives are slow to initialize */
+ /* retry up to 5 times or 31 seconds */
+ rc = TRYMOUNT("vfat")&& TRYMOUNT("ext2")&& TRYMOUNT("iso9660");
+ while (rc&& (i++< 5)) {
+ sleep(s);
+ s<<= 1;
+ logMessage(DEBUGLVL, "sleeping to wait for USB storage devices");
+ rc = TRYMOUNT("vfat")&& TRYMOUNT("ext2")&& TRYMOUNT("iso9660");
+ }
Can we make this a for loop please, also I would prefer to see s as:
s = 1 << i;
But that might just be me :)
I was trying to follow the style set by the sleeping loop in
kickstartFromFloppy() in kickstart.c, so if this is converted into a for
loop, then all 3 while loops should probably be converted.
1. kickstartFromFloppy() in kickstart.c
2. kickstartFromCD() in cdinstall.c
3. getFileFromBlockDevice() in method.c
Jeff
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list