From f9ec6ca5c9a018b95f876d2d8632f58db1fe94a8 Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Thu, 24 Aug 2000 10:41:52 +0000 Subject: Be careful about hzto returning <= 0. --- sys/compat/hpux/hpux_compat.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/compat/hpux/hpux_compat.c b/sys/compat/hpux/hpux_compat.c index f55d32cd2ae..c7837715054 100644 --- a/sys/compat/hpux/hpux_compat.c +++ b/sys/compat/hpux/hpux_compat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hpux_compat.c,v 1.11 2000/06/26 16:22:11 art Exp $ */ +/* $OpenBSD: hpux_compat.c,v 1.12 2000/08/24 10:41:51 art Exp $ */ /* $NetBSD: hpux_compat.c,v 1.35 1997/05/08 16:19:48 mycroft Exp $ */ /* @@ -1298,6 +1298,7 @@ hpux_sys_alarm_6x(p, v, retval) syscallarg(int) deltat; } */ *uap = v; int s = splhigh(); + int timo; timeout_del(&p->p_realit_to); timerclear(&p->p_realtimer.it_interval); @@ -1312,7 +1313,10 @@ hpux_sys_alarm_6x(p, v, retval) } p->p_realtimer.it_value = time; p->p_realtimer.it_value.tv_sec += SCARG(uap, deltat); - timeout_add(&p->p_realit_to, hzto(&p->p_realtimer.it_value)); + timo = hzto(&p->p_realtimer.it_value); + if (timo <= 0) + timo = 1; + timeout_add(&p->p_realit_to, timo); splx(s); return (0); } -- cgit v1.2.3