cdrom.c, disk.c: poke lazy udev to do its job

See also https://bugzilla.altlinux.org/30315
This commit is contained in:
Michael Shigorin 2015-03-10 01:26:53 +03:00
parent 22183d47a8
commit ce7dbcef2b
2 changed files with 6 additions and 2 deletions

View File

@ -192,12 +192,14 @@ enum return_type cdrom_prepare(void)
char * choice; char * choice;
int i, count = 0; int i, count = 0;
enum return_type results; enum return_type results;
int timeout=60; int timeout=32;
int period=5;
update_splash("prepare"); update_splash("prepare");
fprintf(stderr,"%c[1A",27); fprintf(stderr,"%c[1A",27);
for(i=0; i<timeout; i++) { for(i=0; i<timeout; i++) {
if(i%period==0) system("udevadm trigger --action=add");
sleep(1); sleep(1);
if(opendir("/dev/disk/"))break; if(opendir("/dev/disk/"))break;
fprintf(stderr,"\rwaiting for /dev/disk/ %d...",i); fprintf(stderr,"\rwaiting for /dev/disk/ %d...",i);

4
disk.c
View File

@ -331,10 +331,12 @@ enum return_type disk_prepare(void)
char msg[256]; char msg[256];
int i, count = 0; int i, count = 0;
enum return_type results; enum return_type results;
int timeout = 60; int timeout = 32;
int period = 5;
update_splash("prepare"); update_splash("prepare");
fprintf(stderr,"%c[1A",27); fprintf(stderr,"%c[1A",27);
for(i=0; i<timeout; i++) { for(i=0; i<timeout; i++) {
if(i%period==0) system("udevadm trigger --action=add");
sleep(1); sleep(1);
if(opendir("/dev/disk/"))break; if(opendir("/dev/disk/"))break;
fprintf(stderr,"\rwaiting for /dev/disk/ %d...",i); fprintf(stderr,"\rwaiting for /dev/disk/ %d...",i);