From 33a9755e2711ce05ef036f85b344025a3b632d55 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sat, 15 Jan 2000 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 2000-01-15 --- port/devsdp.c | 6 +++--- port/proc.c | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/port/devsdp.c b/port/devsdp.c index 06a475e6544d380a569335fbc1b47852b09afd02..59bd2b2cb1aa262c7ba28728a5f34deac6aa337e 100644 --- a/port/devsdp.c +++ b/port/devsdp.c @@ -328,8 +328,8 @@ static Algorithm cipheralg[] = static Algorithm authalg[] = { "null", 0, nullauthinit, - "seanq_hmac_sha1_96", 16, shaauthinit, - "seanq_hmac_md5_96", 16, md5authinit, + "hmac_sha1_96", 16, shaauthinit, + "hmac_md5_96", 16, md5authinit, nil, 0, nil, }; @@ -993,7 +993,7 @@ print("convsetstate %s -> %s\n", convstatename[c->state], convstatename[state]); hnputl(c->out.secret, c->acceptid); hnputl(c->out.secret+4, c->dialid); } - setalg(c, "seanq_hmac_md5_96", authalg, &c->auth); + setalg(c, "hmac_md5_96", authalg, &c->auth); break; case CLocalClose: assert(c->state == CAccept || c->state == COpen); diff --git a/port/proc.c b/port/proc.c index 065debd095caed67925feb4cef7d373cf93c9722..1bc5d9a229b345e7b8bd89665eacba10102bb341 100644 --- a/port/proc.c +++ b/port/proc.c @@ -527,7 +527,12 @@ tsleep(Rendez *r, int (*fn)(void*), void *arg, int ms) ulong when; Proc *f, **l; - when = MS2TK(ms)+MACHP(0)->ticks; + // avoid overflows at the cost of precision + if(ms >= 1000000) + when = ms/(1000/HZ); + else + when = MS2TK(ms); + when += MACHP(0)->ticks; lock(&talarm); /* take out of list if checkalarm didn't */