sleep sometimes hangs. This is corrected
This commit is contained in:
parent
913a1f0b8f
commit
08ad853ac5
1 changed files with 3 additions and 3 deletions
|
@ -26,9 +26,9 @@ sleep(n)
|
||||||
enough
|
enough
|
||||||
*/
|
*/
|
||||||
if (oldalarm > n) oldalarm -= n;
|
if (oldalarm > n) oldalarm -= n;
|
||||||
else {
|
else if (oldalarm) {
|
||||||
n = oldalarm;
|
n = oldalarm;
|
||||||
oldalarm = 1;
|
oldalarm = 1;
|
||||||
}
|
}
|
||||||
oldsig = signal(SIGALRM, alfun);
|
oldsig = signal(SIGALRM, alfun);
|
||||||
alarm(n);
|
alarm(n);
|
||||||
|
|
Loading…
Reference in a new issue