diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-01-03 01:40:17 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-01-03 01:40:17 +0100 |
commit | 8ebe3f680e9f343a13bfcaaa2e17745b701ec0c8 (patch) | |
tree | d85286feff363c0d715eb5c0f41ba22c670241e5 /rc/bin/9fs | |
parent | d1be5e163c98c99b3b610dc5f4715455d506ba22 (diff) | |
download | plan9front-8ebe3f680e9f343a13bfcaaa2e17745b701ec0c8.tar.xz |
alarm: skip timed out alarms when inserting in procalarm() (thanks erik)
from erik quanstros 9fans post:
i think the list insertion code needs a single-read
test that f->alarm != 0. to prevent the 0 from
acting like a fencepost. e.g. trying to insert -10 into
list -40 -30 0 -20.
if(alarms.head) {
l = &alarms.head;
for(f = *l; f; f = f->palarm) {
>> fw = f->alarm;
>> if(fw != 0 && (long)(fw - when) >= 0) {
up->palarm = f;
*l = up;
goto done;
}
l = &f->palarm;
}
*l = up;
}
Diffstat (limited to 'rc/bin/9fs')
0 files changed, 0 insertions, 0 deletions