diff --git a/ChangeLog b/ChangeLog index 6ba48d5dc..3aa9ce73f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-02-13 Pierre Willenbrock + Patch by Stefan Lucke + * backend/genesys_gl841.c: Fixes 3 possibilities for infinite + loops and adjusts loop threshold to given comments + 2008-02-13 Jonathan Bravo Lopez * backend/hp3900.c, backend/hp3900_debug.c, backend/hp3900_rts8822.c, backend/hp3900_usb.c, backend/hp3900_sane.c, backend/hp3900_types.c, diff --git a/backend/genesys_gl841.c b/backend/genesys_gl841.c index 3977ffec0..8517a8740 100644 --- a/backend/genesys_gl841.c +++ b/backend/genesys_gl841.c @@ -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,