Patch by Stefan Lucke <stefan@lucke.in-berlin.de>

* backend/genesys_gl841.c: Fixes 3 possibilities for infinite
  loops and adjusts loop threshold to given comments
merge-requests/1/head
Pierre Willenbrock 2008-02-13 12:20:04 +00:00
rodzic e1f9664106
commit 91644b76b9
2 zmienionych plików z 10 dodań i 2 usunięć

Wyświetl plik

@ -1,3 +1,8 @@
2008-02-13 Pierre Willenbrock <pierre@pirsoft.dnsalias.org>
Patch by Stefan Lucke <stefan@lucke.in-berlin.de>
* backend/genesys_gl841.c: Fixes 3 possibilities for infinite
loops and adjusts loop threshold to given comments
2008-02-13 Jonathan Bravo Lopez <jkdsoft@gmail.com>
* backend/hp3900.c, backend/hp3900_debug.c, backend/hp3900_rts8822.c,
backend/hp3900_usb.c, backend/hp3900_sane.c, backend/hp3900_types.c,

Wyświetl plik

@ -3434,7 +3434,7 @@ gl841_feed (Genesys_Device * dev, int steps)
return status;
}
while (loop < 3) /* do not wait longer then 30 seconds */
while (loop < 300) /* do not wait longer then 30 seconds */
{
status = sanei_genesys_get_status (dev, &val);
if (status != SANE_STATUS_GOOD)
@ -3452,6 +3452,7 @@ gl841_feed (Genesys_Device * dev, int steps)
return SANE_STATUS_GOOD;
}
usleep (100000); /* sleep 100 ms */
++loop;
}
/* when we come here then the scanner needed too much time for this, so we better stop the motor */
@ -3579,7 +3580,7 @@ gl841_slow_back_home (Genesys_Device * dev, SANE_Bool wait_until_home)
{
int loop = 0;
while (loop < 3) /* do not wait longer then 30 seconds */
while (loop < 300) /* do not wait longer then 30 seconds */
{
status = sanei_genesys_get_status (dev, &val);
if (status != SANE_STATUS_GOOD)
@ -3598,6 +3599,7 @@ gl841_slow_back_home (Genesys_Device * dev, SANE_Bool wait_until_home)
return SANE_STATUS_GOOD;
}
usleep (100000); /* sleep 100 ms */
++loop;
}
/* when we come here then the scanner needed too much time for this, so we better stop the motor */
@ -3729,6 +3731,7 @@ gl841_park_head (Genesys_Device * dev, Genesys_Register_Set * reg,
}
}
usleep (100000);
++loop;
}
} else {
DBG (DBG_info,