Re: [rhel5-branch] Sleep if the kickstart file read fails.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/10/2009 01:37 PM, Jeffrey Bastian wrote:
> 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

This function hasn't existed since 2007, and didn't have a loop like
you're describing then.

>   2. kickstartFromCD() in cdinstall.c

This has no such loop.

>   3. getFileFromBlockDevice() in method.c

This also has no such loop...

-- 
        Peter

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux