|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
interrupted twice by a signal.
If we're interrupted only once, there's no problem. If we're
interrupted twice, we subtract the elapsed time since the beginning
from the remaining time, so this won't work. The correct thing is to
recalculate from the original timeout value.
This is extremely difficult to test, since it requires that the
select(2) call be interrupted twice by signals. The only way to do
this is by sending two signals to a program from another program (or
threads, with pthread_kill(3)) with less than half of the time left,
then send data to cause the loop to exit with success.
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
|